File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -15,25 +15,37 @@ class EntityQuery extends Query implements \Countable
1515 private $ field ;
1616
1717
18+ /**
19+ * @param string $field
20+ */
1821 public function __construct (Entity $ entity , $ field )
1922 {
2023 $ this ->entity = $ entity ;
2124 $ this ->field = $ field ;
2225 }
2326
2427
28+ /**
29+ * @return Entity[]
30+ */
2531 public function find ()
2632 {
2733 return $ this ->entity ->find ($ this ->field , $ this );
2834 }
2935
3036
37+ /**
38+ * @return Entity|NULL
39+ */
3140 public function findOne ()
3241 {
3342 return $ this ->entity ->findOne ($ this ->field , $ this );
3443 }
3544
3645
46+ /**
47+ * @return int
48+ */
3749 public function count ()
3850 {
3951 return $ this ->entity ->findCount ($ this ->field , $ this );
Original file line number Diff line number Diff line change 33 namespace Inlm \Model ;
44
55 use LeanMapperQuery \Query ;
6+ use LeanMapper \Entity ;
67 use LeanMapper \Repository ;
78
89
@@ -18,18 +19,27 @@ public function __construct(Repository $repository)
1819 }
1920
2021
22+ /**
23+ * @return Entity[]
24+ */
2125 public function find ()
2226 {
2327 return $ this ->repository ->find ($ this );
2428 }
2529
2630
31+ /**
32+ * @return Entity|NULL
33+ */
2734 public function findOne ()
2835 {
2936 return $ this ->repository ->findOne ($ this );
3037 }
3138
3239
40+ /**
41+ * @return int
42+ */
3343 public function count ()
3444 {
3545 return $ this ->repository ->findCount ($ this );
You can’t perform that action at this time.
0 commit comments