@@ -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=[]; |
@@ -77,6 +77,11 @@ |
||
| 77 | 77 | } |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | + /** |
|
| 81 | + * @param string $header |
|
| 82 | + * |
|
| 83 | + * @return string |
|
| 84 | + */ |
|
| 80 | 85 | public function _getHeader($header) { |
| 81 | 86 | $headers=getallheaders(); |
| 82 | 87 | if (isset($headers[$header])) { |
@@ -77,6 +77,10 @@ |
||
| 77 | 77 | return $newstring; |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | + /** |
|
| 81 | + * @param string $pattern |
|
| 82 | + * @param string $replacement |
|
| 83 | + */ |
|
| 80 | 84 | public static function replaceFirstOccurrence($pattern, $replacement, $subject){ |
| 81 | 85 | $pattern = '/'.preg_quote($pattern, '/').'/'; |
| 82 | 86 | return preg_replace($pattern, $replacement, $subject, 1); |
@@ -8,6 +8,9 @@ |
||
| 8 | 8 | |
| 9 | 9 | private static $locales=["fr"=>["fr","fr_FR","fr_FR.ISO8859-1"],"en"=>["en","en_US","en_US.UTF-8"]]; |
| 10 | 10 | |
| 11 | + /** |
|
| 12 | + * @param string $locale |
|
| 13 | + */ |
|
| 11 | 14 | private static function setLocale($locale){ |
| 12 | 15 | if(isset(self::$locales[$locale])){ |
| 13 | 16 | $locale= self::$locales[$locale]; |
@@ -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); |
@@ -36,6 +36,7 @@ discard block |
||
| 36 | 36 | * @param string $password |
| 37 | 37 | * @param array $options |
| 38 | 38 | * @param boolean|string $cache |
| 39 | + * @param string $dbType |
|
| 39 | 40 | */ |
| 40 | 41 | public function __construct($dbType, $dbName, $serverName = "localhost", $port = "3306", $user = "root", $password = "", $options = [], $cache = false) { |
| 41 | 42 | $this->dbType = $dbType; |
@@ -122,6 +123,9 @@ discard block |
||
| 122 | 123 | return $result; |
| 123 | 124 | } |
| 124 | 125 | |
| 126 | + /** |
|
| 127 | + * @param string $sql |
|
| 128 | + */ |
|
| 125 | 129 | public function prepareAndFetchAll($sql,$parameters=null){ |
| 126 | 130 | $result=false; |
| 127 | 131 | $statement=$this->getStatement($sql); |
@@ -144,6 +148,9 @@ discard block |
||
| 144 | 148 | return $result; |
| 145 | 149 | } |
| 146 | 150 | |
| 151 | + /** |
|
| 152 | + * @param string $sql |
|
| 153 | + */ |
|
| 147 | 154 | public function prepareAndFetchColumn($sql,$parameters=null,$column=null){ |
| 148 | 155 | $statement=$this->getStatement($sql); |
| 149 | 156 | if($statement->execute ($parameters)){ |
@@ -209,7 +216,7 @@ discard block |
||
| 209 | 216 | /** |
| 210 | 217 | * Returns the last insert id |
| 211 | 218 | * |
| 212 | - * @return integer |
|
| 219 | + * @return string |
|
| 213 | 220 | */ |
| 214 | 221 | public function lastInserId() { |
| 215 | 222 | return $this->pdoObject->lastInsertId (); |
@@ -234,6 +241,9 @@ discard block |
||
| 234 | 241 | return $this->query ( "SELECT COUNT(*) FROM " . $tableName . $condition )->fetchColumn (); |
| 235 | 242 | } |
| 236 | 243 | |
| 244 | + /** |
|
| 245 | + * @param string $query |
|
| 246 | + */ |
|
| 237 | 247 | public function queryColumn($query){ |
| 238 | 248 | return $this->query ( $query )->fetchColumn (); |
| 239 | 249 | } |
@@ -13,9 +13,21 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | protected static $annotFieldsInRelations=[]; |
| 15 | 15 | |
| 16 | + /** |
|
| 17 | + * @param string $className |
|
| 18 | + * @param boolean $useCache |
|
| 19 | + */ |
|
| 16 | 20 | abstract protected static function _getAll($className, ConditionParser $conditionParser, $included=true,$useCache=NULL); |
| 21 | + |
|
| 22 | + /** |
|
| 23 | + * @param string $className |
|
| 24 | + * @param boolean|null $useCache |
|
| 25 | + */ |
|
| 17 | 26 | abstract protected static function _getOne($className,ConditionParser $conditionParser,$included,$useCache); |
| 18 | 27 | |
| 28 | + /** |
|
| 29 | + * @param string $className |
|
| 30 | + */ |
|
| 19 | 31 | protected static function uParse($className,&$ucondition){ |
| 20 | 32 | $expressions=self::uGetExpressions($ucondition); |
| 21 | 33 | $condition=""; |
@@ -62,7 +74,7 @@ discard block |
||
| 62 | 74 | /** |
| 63 | 75 | * Returns an array of $className objects from the database |
| 64 | 76 | * @param string $className class name of the model to load |
| 65 | - * @param string $condition UQL condition |
|
| 77 | + * @param string $ucondition UQL condition |
|
| 66 | 78 | * @param boolean|array $included if true, loads associate members with associations, if array, example : ["client.*","commands"] |
| 67 | 79 | * @param array|null $parameters the request parameters |
| 68 | 80 | * @param boolean $useCache use the active cache if true |
@@ -207,6 +207,9 @@ discard block |
||
| 207 | 207 | |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | + /** |
|
| 211 | + * @param string $viewName |
|
| 212 | + */ |
|
| 210 | 213 | private function authLoadView($viewName,$vars=[]){ |
| 211 | 214 | $files=$this->_getFiles(); |
| 212 | 215 | $mainTemplate=$files->getBaseTemplate(); |
@@ -270,6 +273,9 @@ discard block |
||
| 270 | 273 | return $this->loadView($this->_getFiles()->getViewInfo(),["connected"=>USession::get($this->_getUserSessionKey()),"authURL"=>$this->getBaseUrl(),"bodySelector"=>$this->_getBodySelector()],$displayInfoAsString); |
| 271 | 274 | } |
| 272 | 275 | |
| 276 | + /** |
|
| 277 | + * @param string $id |
|
| 278 | + */ |
|
| 273 | 279 | protected function fMessage(FlashMessage $fMessage,$id=null){ |
| 274 | 280 | return $this->message($fMessage->getType(), $fMessage->getTitle(), $fMessage->getContent(),$fMessage->getIcon(),$id); |
| 275 | 281 | } |
@@ -47,6 +47,7 @@ discard block |
||
| 47 | 47 | /** |
| 48 | 48 | * {@inheritDoc} |
| 49 | 49 | * @see \Ubiquity\controllers\Controller::isValid() |
| 50 | + * @param string $action |
|
| 50 | 51 | */ |
| 51 | 52 | public function isValid($action) { |
| 52 | 53 | $authCtrl=$this->_getAuthController(); |
@@ -89,6 +90,9 @@ discard block |
||
| 89 | 90 | protected abstract function getAuthController():AuthController; |
| 90 | 91 | |
| 91 | 92 | |
| 93 | + /** |
|
| 94 | + * @param AuthController $authController |
|
| 95 | + */ |
|
| 92 | 96 | protected function checkConnection($authController){ |
| 93 | 97 | if($authController->_checkConnectionTimeout()!==null){ |
| 94 | 98 | $ret=$authController->_disconnected(); |