FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
data-repository/src/RepositoryQuery.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
/
RepositoryQuery.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
90 lines (75 loc) · 2.09 KB
Breadcrumbs
data-repository
/
src
/
RepositoryQuery.php
Copy path
File metadata and controls
90 lines (75 loc) · 2.09 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
namespace
G4
\
DataRepository
;
use
G4
\
DataRepository
\
Exception
\
InvalidQueryException
;
use
G4
\
DataRepository
\
Exception
\
MissingIdentityException
;
use
G4
\
DataRepository
\
Exception
\
MissingIdentityMapKeyException
;
use
G4
\
DataRepository
\
Exception
\
MissingRussianDollKeyException
;
class
RepositoryQuery
{
const
DELIMITER
=
"
|
"
;
/*
* @var \G4\DataMapper\Common\IdentityInterface
*/
private
$
identity
;
private
$
identityMapKey
;
private
$
customQuery
;
/*
* @var \G4\RussianDoll\Key
*/
private
$
russianDollKey
;
/**
* @return \G4\DataMapper\Common\IdentityInterface
*/
public
function
getIdentity
()
{
if
(!
$
this
->
identity
instanceof
\
G4
\
DataMapper
\
Common
\IdentityInterface) {
throw
new
MissingIdentityException
();
}
return
$
this
->
identity
;
}
public
function
getRussianDollKey
()
{
if
(!
$
this
->
russianDollKey
instanceof
\
G4
\
RussianDoll
\Key) {
throw
new
MissingRussianDollKeyException
();
}
return
$
this
->
russianDollKey
;
}
public
function
getIdentityMapKey
()
{
if
(
empty
(
$
this
->
identityMapKey
)) {
throw
new
MissingIdentityMapKeyException
();
}
return
$
this
->
identityMapKey
;
}
public
function
getCustomQuery
()
{
if
(!
$
this
->
hasCustomQuery
()) {
throw
new
InvalidQueryException
();
}
return
$
this
->
customQuery
;
}
public
function
setIdentity
(
\
G4
\
DataMapper
\
Common
\
IdentityInterface
$
identity
)
{
$
this
->
identity
=
$
identity
;
return
$
this
;
}
public
function
setRussianDollKey
(
\
G4
\
RussianDoll
\
Key
$
russianDollKey
)
{
$
this
->
russianDollKey
=
$
russianDollKey
;
return
$
this
;
}
public
function
setIdentityMapKey
(...
$
identityMapKey
)
{
$
this
->
identityMapKey
=
join
(
self
::
DELIMITER
,
$
identityMapKey
);
return
$
this
;
}
public
function
setCustomQuery
(
$
query
)
{
$
this
->
customQuery
=
$
query
;
return
$
this
;
}
public
function
hasCustomQuery
()
{
return
!
empty
(
$
this
->
customQuery
);
}
}
Back
|
FazBrowse Home
|
New Git URL