@@ -74,6 +74,11 @@ |
||
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | + /** |
|
| 78 | + * @param string $header |
|
| 79 | + * |
|
| 80 | + * @return string |
|
| 81 | + */ |
|
| 77 | 82 | public function _getHeader($header){ |
| 78 | 83 | $headers=getallheaders(); |
| 79 | 84 | if(isset($headers[$header])){ |
@@ -122,6 +122,9 @@ |
||
| 122 | 122 | return $this->_getYumlRelationsType($this->oneToManys,"1-0..*"); |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | + /** |
|
| 126 | + * @param string $branche |
|
| 127 | + */ |
|
| 125 | 128 | protected function _getYumlRelationsType($relations,$branche){ |
| 126 | 129 | $myClass=$this->getShortClassName($this->class); |
| 127 | 130 | $yumlRelations=[]; |
@@ -3,8 +3,6 @@ |
||
| 3 | 3 | namespace Ubiquity\utils\yuml; |
| 4 | 4 | |
| 5 | 5 | use Ubiquity\orm\OrmUtils; |
| 6 | -use Ubiquity\orm\parser\Reflexion; |
|
| 7 | -use Ubiquity\utils\StrUtils; |
|
| 8 | 6 | |
| 9 | 7 | /** |
| 10 | 8 | * @author jc |
@@ -73,6 +73,9 @@ discard block |
||
| 73 | 73 | return "/" . \implode("/", $pathParts); |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | + /** |
|
| 77 | + * @param string $prefix |
|
| 78 | + */ |
|
| 76 | 79 | private static function cleanpath($prefix, $path="") { |
| 77 | 80 | if (!StrUtils::endswith($prefix, "/")) |
| 78 | 81 | $prefix=$prefix . "/"; |
@@ -154,6 +157,10 @@ discard block |
||
| 154 | 157 | return [ "path" => $path,"parameters" => $parameters ]; |
| 155 | 158 | } |
| 156 | 159 | |
| 160 | + /** |
|
| 161 | + * @param integer $index |
|
| 162 | + * @param string $paramMatch |
|
| 163 | + */ |
|
| 157 | 164 | private static function scanParam(&$parameters, &$hasOptional, $matches, $index, $paramMatch, $find, &$path) { |
| 158 | 165 | if (isset($matches[1][$index])) { |
| 159 | 166 | if ($matches[1][$index] === "...") { |
@@ -173,6 +180,9 @@ discard block |
||
| 173 | 180 | } |
| 174 | 181 | } |
| 175 | 182 | |
| 183 | + /** |
|
| 184 | + * @param string $path |
|
| 185 | + */ |
|
| 176 | 186 | private static function createRouteMethod(&$result, $controllerClass, $path, $httpMethods, $method, $parameters, $name, $cache, $duration) { |
| 177 | 187 | foreach ( $httpMethods as $httpMethod ) { |
| 178 | 188 | $result[$path][$httpMethod]=[ "controller" => $controllerClass,"action" => $method,"parameters" => $parameters,"name" => $name,"cache" => $cache,"duration" => $duration ]; |
@@ -144,6 +144,9 @@ |
||
| 144 | 144 | self::$config=$config; |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | + /** |
|
| 148 | + * @param string[] $needs |
|
| 149 | + */ |
|
| 147 | 150 | private static function needsKeyInConfigArray(&$result, $array, $needs) { |
| 148 | 151 | foreach ( $needs as $need ) { |
| 149 | 152 | if (!isset($array[$need]) || StrUtils::isNull($array[$need])) { |
@@ -55,6 +55,9 @@ |
||
| 55 | 55 | } |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | + /** |
|
| 59 | + * @param string $propertiesString |
|
| 60 | + */ |
|
| 58 | 61 | private function parseProperties($propertiesString,$table){ |
| 59 | 62 | $properties=\explode(";", $propertiesString); |
| 60 | 63 | foreach ($properties as $property){ |
@@ -106,6 +106,10 @@ discard block |
||
| 106 | 106 | return $ret; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | + /** |
|
| 110 | + * @param string $class |
|
| 111 | + * @param string $part |
|
| 112 | + */ |
|
| 109 | 113 | private static function setToMember($member, $instance, $value, $class, $part) { |
| 110 | 114 | $accessor="set" . ucfirst($member); |
| 111 | 115 | if (method_exists($instance, $accessor)) { |
@@ -157,6 +161,10 @@ discard block |
||
| 157 | 161 | } |
| 158 | 162 | } |
| 159 | 163 | |
| 164 | + /** |
|
| 165 | + * @param string $class |
|
| 166 | + * @param ManyToManyParser $parser |
|
| 167 | + */ |
|
| 160 | 168 | private static function getManyToManyFromArray(&$ret, $instance, $array, $class, $parser) { |
| 161 | 169 | $continue=true; |
| 162 | 170 | $accessorToMember="get" . ucfirst($parser->getInversedBy()); |
@@ -229,6 +237,9 @@ discard block |
||
| 229 | 237 | return $objects; |
| 230 | 238 | } |
| 231 | 239 | |
| 240 | + /** |
|
| 241 | + * @param \Closure $affectsCallback |
|
| 242 | + */ |
|
| 232 | 243 | private static function _affectsObjectsFromArray($queries,$objects,$affectsCallback,$useCache=NULL){ |
| 233 | 244 | foreach ($queries as $key=>$conditions){ |
| 234 | 245 | list($class,$member,$fkField)=\explode("|", $key); |
@@ -328,7 +339,7 @@ discard block |
||
| 328 | 339 | * Returns the number of objects of $className from the database respecting the condition possibly passed as parameter |
| 329 | 340 | * @param string $className complete classname of the model to load |
| 330 | 341 | * @param string $condition Part following the WHERE of an SQL statement |
| 331 | - * @return int count of objects |
|
| 342 | + * @return string count of objects |
|
| 332 | 343 | */ |
| 333 | 344 | public static function count($className, $condition='') { |
| 334 | 345 | $tableName=OrmUtils::getTableName($className); |