@@ -9,5 +9,8 @@ |
||
| 9 | 9 | */ |
| 10 | 10 | interface TableNameResolverInterface |
| 11 | 11 | { |
| 12 | + /** |
|
| 13 | + * @return string |
|
| 14 | + */ |
|
| 12 | 15 | public function getTableName($instance); |
| 13 | 16 | } |
@@ -9,5 +9,8 @@ |
||
| 9 | 9 | */ |
| 10 | 10 | interface ModelJoinerInterface |
| 11 | 11 | { |
| 12 | + /** |
|
| 13 | + * @return string |
|
| 14 | + */ |
|
| 12 | 15 | public function getJunctionClassName($classA, $classB); |
| 13 | 16 | } |
@@ -227,6 +227,9 @@ |
||
| 227 | 227 | } |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | + /** |
|
| 231 | + * @param string $event |
|
| 232 | + */ |
|
| 230 | 233 | private function runBehaviours($event, $args) { |
| 231 | 234 | foreach ($this->wrapper->getBehaviours() as $behaviour) { |
| 232 | 235 | $args[0] = call_user_func_array([$behaviour, $event], $args); |
@@ -190,6 +190,10 @@ |
||
| 190 | 190 | return $return; |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | + /** |
|
| 194 | + * @param integer $level |
|
| 195 | + * @param string $opr |
|
| 196 | + */ |
|
| 193 | 197 | private function parseRightExpression($level, $opr) { |
| 194 | 198 | switch ($opr) { |
| 195 | 199 | case 'between': return $this->parseBetween(); |
@@ -90,6 +90,9 @@ |
||
| 90 | 90 | return $relationshipDetails; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | + /** |
|
| 94 | + * @param string $type |
|
| 95 | + */ |
|
| 93 | 96 | private function createRelationships($type, $relationships) { |
| 94 | 97 | foreach ($relationships as $relationship) { |
| 95 | 98 | $relationship = $this->getRelationshipDetails($relationship); |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | /** |
| 124 | 124 | * @method |
| 125 | - * @param type $name |
|
| 125 | + * @param string $name |
|
| 126 | 126 | * @param type $arguments |
| 127 | 127 | * @return type |
| 128 | 128 | */ |
@@ -148,6 +148,10 @@ discard block |
||
| 148 | 148 | return $this->retrieveItem($name); |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | + /** |
|
| 152 | + * @param Relationship[] $relationships |
|
| 153 | + * @param integer $depth |
|
| 154 | + */ |
|
| 151 | 155 | private function expandArrayValue($array, $relationships, $depth, $index = null) { |
| 152 | 156 | foreach ($relationships as $name => $relationship) { |
| 153 | 157 | $array[$name] = $this->fetchRelatedFields($relationship, $index)->toArray($depth); |
@@ -67,7 +67,9 @@ |
||
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | public static function getInstance() { |
| 70 | - if(self::$instance === null) throw new NibiiException("A context has not yet been initialized"); |
|
| 70 | + if(self::$instance === null) { |
|
| 71 | + throw new NibiiException("A context has not yet been initialized"); |
|
| 72 | + } |
|
| 71 | 73 | return self::$instance; |
| 72 | 74 | } |
| 73 | 75 | |
@@ -10,6 +10,9 @@ discard block |
||
| 10 | 10 | $this->db = $driver; |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | + /** |
|
| 14 | + * @param string $query |
|
| 15 | + */ |
|
| 13 | 16 | private function filter($query) { |
| 14 | 17 | return $query; |
| 15 | 18 | } |
@@ -39,6 +42,9 @@ discard block |
||
| 39 | 42 | ); |
| 40 | 43 | } |
| 41 | 44 | |
| 45 | + /** |
|
| 46 | + * @param QueryParameters $parameters |
|
| 47 | + */ |
|
| 42 | 48 | public function getBulkUpdateQuery($data, $parameters) { |
| 43 | 49 | $updateData = []; |
| 44 | 50 | foreach ($data as $field => $value) { |
@@ -84,6 +90,9 @@ discard block |
||
| 84 | 90 | ); |
| 85 | 91 | } |
| 86 | 92 | |
| 93 | + /** |
|
| 94 | + * @param QueryParameters $parameters |
|
| 95 | + */ |
|
| 87 | 96 | public function getSelectQuery($parameters) { |
| 88 | 97 | return $this->filter(sprintf( |
| 89 | 98 | "SELECT %s FROM %s%s%s%s%s", |
@@ -97,6 +106,9 @@ discard block |
||
| 97 | 106 | ); |
| 98 | 107 | } |
| 99 | 108 | |
| 109 | + /** |
|
| 110 | + * @param QueryParameters $parameters |
|
| 111 | + */ |
|
| 100 | 112 | public function getCountQuery($parameters) { |
| 101 | 113 | return $this->filter(sprintf( |
| 102 | 114 | "SELECT count(*) as count FROM %s%s", |
@@ -106,6 +118,9 @@ discard block |
||
| 106 | 118 | ); |
| 107 | 119 | } |
| 108 | 120 | |
| 121 | + /** |
|
| 122 | + * @param QueryParameters $parameters |
|
| 123 | + */ |
|
| 109 | 124 | public function getDeleteQuery($parameters) { |
| 110 | 125 | return $this->filter(sprintf( |
| 111 | 126 | "DELETE FROM %s%s", |