1 | <?php |
||
14 | abstract class AbstractEndpointRepository implements |
||
15 | DatabaseAwareInterface, |
||
16 | RedisAwareInterface, |
||
17 | UuidAwareInterface |
||
18 | { |
||
19 | use DatabaseAwareTrait; |
||
20 | use RedisAwareTrait; |
||
21 | use UuidAwareTrait; |
||
22 | |||
23 | /** |
||
24 | * Determines the table that the DB is interfacing with |
||
25 | * |
||
26 | * @return string |
||
27 | */ |
||
28 | abstract public function getTable(); |
||
29 | |||
30 | /** |
||
31 | * Determines the primary key of the table |
||
32 | * |
||
33 | * @return string |
||
34 | */ |
||
35 | abstract public function getPrimaryKey(); |
||
36 | |||
37 | /** |
||
38 | * Determines the Result key of the table |
||
39 | * |
||
40 | * @return string |
||
41 | */ |
||
42 | abstract public function getResultKey(); |
||
43 | |||
44 | /** |
||
45 | * Builds a new query factory ready for use with the QueryObjects |
||
46 | * |
||
47 | * @return \Aura\SqlQuery\AbstractQuery |
||
48 | */ |
||
49 | public function newQuery() |
||
50 | { |
||
51 | $factory = new QueryFactory('mysql'); |
||
52 | |||
53 | $query = $factory->newSelect(); // Suspect I'll only ever need this one |
||
54 | $query->from($this->getTable()); |
||
55 | |||
56 | return $query; |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * Executes the statement to the DB and returns the results |
||
61 | * |
||
62 | * @param \Aura\SqlQuery\AbstractQuery $query |
||
63 | * @param boolean $single |
||
64 | * |
||
65 | * @return array |
||
66 | */ |
||
67 | public function fireStatementAndReturn($query, $single = false) |
||
77 | |||
78 | /** |
||
79 | * Allows for Raw SQL firing without the query builder |
||
80 | * |
||
81 | * @param \Aura\SqlQuery\AbstractQuery $query |
||
|
|||
82 | * @param boolean $single |
||
83 | * |
||
84 | * @return array |
||
85 | */ |
||
86 | public function readRaw($sql, $single = false) |
||
96 | |||
97 | /** |
||
98 | * Reads a single record from the database |
||
99 | * |
||
100 | * @param string $id |
||
101 | * |
||
102 | * @return array |
||
103 | */ |
||
104 | public function readSinglebyId($id, $keyType = 'primary') |
||
114 | |||
115 | /** |
||
116 | * Reads all related records from the database |
||
117 | * |
||
118 | * @param string $id |
||
119 | * |
||
120 | * @return array |
||
121 | */ |
||
122 | public function readAllById($id, $keyType = 'primary') |
||
132 | |||
133 | /** |
||
134 | * Reads all records based off a simple where statement |
||
135 | * |
||
136 | * @param array $fields |
||
137 | * |
||
138 | * @return array |
||
139 | */ |
||
140 | public function readAllByFields($fields) |
||
152 | |||
153 | /** |
||
154 | * Reads the count of records based off a where statement |
||
155 | * |
||
156 | * @param array $fields |
||
157 | * |
||
158 | * @return array |
||
159 | */ |
||
160 | public function readCountByFields($fields) |
||
176 | |||
177 | /** |
||
178 | * Sets the proper key to search on based off a string |
||
179 | * |
||
180 | * @param string $key |
||
181 | * |
||
182 | * @return string |
||
183 | */ |
||
184 | public function returnKeyType($key) |
||
194 | } |
||
195 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.