@@ -44,6 +44,9 @@ discard block |
||
| 44 | 44 | $this->onInvalidControl (); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | + /** |
|
| 48 | + * @param string $action |
|
| 49 | + */ |
|
| 47 | 50 | public function isValid($action){ |
| 48 | 51 | if(isset($this->restCache["authorizations"])){ |
| 49 | 52 | if(\array_search($action, $this->restCache["authorizations"])!==false){ |
@@ -172,6 +175,9 @@ discard block |
||
| 172 | 175 | } |
| 173 | 176 | } |
| 174 | 177 | |
| 178 | + /** |
|
| 179 | + * @param boolean|string $included |
|
| 180 | + */ |
|
| 175 | 181 | private function getIncluded($included){ |
| 176 | 182 | if(!UString::isBoolean($included)){ |
| 177 | 183 | return explode(",", $included); |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | * Loads member associated with $instance by a ManyToOne type relationship |
| 30 | 30 | * @param object $instance |
| 31 | 31 | * @param string $member |
| 32 | - * @param boolean|array $included if true, loads associate members with associations, if array, example : ["client.*","commands"] |
|
| 32 | + * @param boolean $included if true, loads associate members with associations, if array, example : ["client.*","commands"] |
|
| 33 | 33 | * @param boolean $useCache |
| 34 | 34 | */ |
| 35 | 35 | public static function getManyToOne($instance, $member, $included=false,$useCache=NULL) { |
@@ -115,6 +115,11 @@ discard block |
||
| 115 | 115 | return $ret; |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | + /** |
|
| 119 | + * @param string $member |
|
| 120 | + * @param string $class |
|
| 121 | + * @param string $part |
|
| 122 | + */ |
|
| 118 | 123 | private static function setToMember($member, $instance, $value, $class, $part) { |
| 119 | 124 | $accessor="set" . ucfirst($member); |
| 120 | 125 | if (method_exists($instance, $accessor)) { |
@@ -167,6 +172,10 @@ discard block |
||
| 167 | 172 | } |
| 168 | 173 | } |
| 169 | 174 | |
| 175 | + /** |
|
| 176 | + * @param string $class |
|
| 177 | + * @param ManyToManyParser $parser |
|
| 178 | + */ |
|
| 170 | 179 | private static function getManyToManyFromArray($instance, $array, $class, $parser) { |
| 171 | 180 | $ret=[]; |
| 172 | 181 | $continue=true; |
@@ -245,6 +254,9 @@ discard block |
||
| 245 | 254 | return $objects; |
| 246 | 255 | } |
| 247 | 256 | |
| 257 | + /** |
|
| 258 | + * @param string $condition |
|
| 259 | + */ |
|
| 248 | 260 | public static function paginate($className,$page=1,$rowsPerPage=20,$condition=null,$included=true){ |
| 249 | 261 | if(!isset($condition)){ |
| 250 | 262 | $condition="1=1"; |
@@ -306,7 +318,7 @@ discard block |
||
| 306 | 318 | * Returns the number of objects of $className from the database respecting the condition possibly passed as parameter |
| 307 | 319 | * @param string $className complete classname of the model to load |
| 308 | 320 | * @param string $condition Part following the WHERE of an SQL statement |
| 309 | - * @return int count of objects |
|
| 321 | + * @return string count of objects |
|
| 310 | 322 | */ |
| 311 | 323 | public static function count($className, $condition='') { |
| 312 | 324 | $tableName=OrmUtils::getTableName($className); |