FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
data-repository/src/SimpleDataRepositoryResponse.php at master · g4code/data-repository · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
g4code
/
data-repository
Public
Notifications
You must be signed in to change notification settings
Fork
5
Star
0
Code
Issues
0
Pull requests
1
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
data-repository
/
src
/
SimpleDataRepositoryResponse.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
44 lines (36 loc) · 898 Bytes
Breadcrumbs
data-repository
/
src
/
SimpleDataRepositoryResponse.php
Copy path
File metadata and controls
44 lines (36 loc) · 898 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
namespace
G4
\
DataRepository
;
use
G4
\
DataRepository
\
Exception
\
MissingResponseAllDataException
;
use
G4
\
DataRepository
\
Exception
\
MissingResponseOneDataException
;
class
SimpleDataRepositoryResponse
{
private
$
data
;
private
$
count
;
public
function
__construct
(
array
$
currentItems
,
$
count
)
{
$
this
->
data
=
$
currentItems
;
$
this
->
count
=
$
count
;
}
public
function
count
()
{
return
$
this
->
count
;
}
public
function
getAll
()
{
if
(!
$
this
->
hasData
()) {
throw
new
MissingResponseAllDataException
();
}
return
$
this
->
data
;
}
public
function
getOne
()
{
if
(!
$
this
->
hasData
()) {
throw
new
MissingResponseOneDataException
();
}
return
current
(
$
this
->
data
);
}
public
function
hasData
()
{
return
count
(
$
this
->
data
) !==
0
;
}
}
Back
|
FazBrowse Home
|
New Git URL