@@ -276,7 +276,7 @@ |
||
| 276 | 276 | * Execute query |
| 277 | 277 | * |
| 278 | 278 | * @param Query $query |
| 279 | - * @param $ttl |
|
| 279 | + * @param integer|null $ttl |
|
| 280 | 280 | * @return QueryResult |
| 281 | 281 | * @throws \Exception |
| 282 | 282 | * @author dp <[email protected]> |
@@ -10,7 +10,6 @@ |
||
| 10 | 10 | namespace Ice\Core; |
| 11 | 11 | |
| 12 | 12 | use Ice\Core; |
| 13 | -use Ice\Helper\String; |
|
| 14 | 13 | |
| 15 | 14 | /** |
| 16 | 15 | * Class DataSource |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | * Retern Data Provider by class name |
| 136 | 136 | * |
| 137 | 137 | * @param string $class Class (found data provider for this class) |
| 138 | - * @param $key |
|
| 138 | + * @param string|null $key |
|
| 139 | 139 | * @param string $index Index of data provider |
| 140 | 140 | * @return DataProvider |
| 141 | 141 | * @author dp <[email protected]> |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | /** |
| 152 | 152 | * Return data provider key by class name |
| 153 | 153 | * |
| 154 | - * @param $class |
|
| 154 | + * @param string $class |
|
| 155 | 155 | * @param $key |
| 156 | 156 | * @return string |
| 157 | 157 | * @author dp <[email protected]> |
@@ -215,6 +215,9 @@ discard block |
||
| 215 | 215 | ])->save(true); |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | + /** |
|
| 219 | + * @param string $type |
|
| 220 | + */ |
|
| 218 | 221 | private function getFbType($type) |
| 219 | 222 | { |
| 220 | 223 | switch ($type) { |
@@ -501,8 +504,8 @@ discard block |
||
| 501 | 504 | * Warning |
| 502 | 505 | * |
| 503 | 506 | * @param $message |
| 504 | - * @param $file |
|
| 505 | - * @param $line |
|
| 507 | + * @param string $file |
|
| 508 | + * @param integer $line |
|
| 506 | 509 | * @param \Exception $e |
| 507 | 510 | * @param null $errcontext |
| 508 | 511 | * @param int $errno |
@@ -522,8 +525,8 @@ discard block |
||
| 522 | 525 | * Fatal - throw ice exception |
| 523 | 526 | * |
| 524 | 527 | * @param $message |
| 525 | - * @param $file |
|
| 526 | - * @param $line |
|
| 528 | + * @param string $file |
|
| 529 | + * @param integer $line |
|
| 527 | 530 | * @param \Exception $e |
| 528 | 531 | * @param null $errcontext |
| 529 | 532 | * @param int $errno |
@@ -548,6 +551,10 @@ discard block |
||
| 548 | 551 | throw $this->createException($message, $file, $line, $e, $errcontext, $errno, $exceptionClass); |
| 549 | 552 | } |
| 550 | 553 | |
| 554 | + /** |
|
| 555 | + * @param string $value |
|
| 556 | + * @param string $label |
|
| 557 | + */ |
|
| 551 | 558 | public static function log($value, $label = null, $type = 'LOG', $options = []) |
| 552 | 559 | { |
| 553 | 560 | $value = str_replace(["\n", "\t"], ' ', $value); |
@@ -283,6 +283,10 @@ discard block |
||
| 283 | 283 | return $this; |
| 284 | 284 | } |
| 285 | 285 | |
| 286 | + /** |
|
| 287 | + * @param string $model |
|
| 288 | + * @param boolean $isAffected |
|
| 289 | + */ |
|
| 286 | 290 | private function setModelValue($model, $isAffected) |
| 287 | 291 | { |
| 288 | 292 | if (!($model instanceof Model)) { |
@@ -338,7 +342,7 @@ discard block |
||
| 338 | 342 | /** |
| 339 | 343 | * Gets full model field name if send short name (for example: '/name' for model User -> user_name) |
| 340 | 344 | * |
| 341 | - * @param $fieldName |
|
| 345 | + * @param string|null $fieldName |
|
| 342 | 346 | * @return string |
| 343 | 347 | * |
| 344 | 348 | * @author dp <[email protected]> |
@@ -361,6 +365,10 @@ discard block |
||
| 361 | 365 | return $fieldName; |
| 362 | 366 | } |
| 363 | 367 | |
| 368 | + /** |
|
| 369 | + * @param string $fieldName |
|
| 370 | + * @param boolean $isAffected |
|
| 371 | + */ |
|
| 364 | 372 | private function setPkValue($fieldName, $fieldValue, $isAffected) |
| 365 | 373 | { |
| 366 | 374 | if (!$this->isPkName($fieldName)) { |
@@ -473,6 +481,10 @@ discard block |
||
| 473 | 481 | return array_key_exists($fieldName, $this->row); |
| 474 | 482 | } |
| 475 | 483 | |
| 484 | + /** |
|
| 485 | + * @param string $fieldName |
|
| 486 | + * @param boolean $isAffected |
|
| 487 | + */ |
|
| 476 | 488 | private function setValue($fieldName, $fieldValue, $isAffected) |
| 477 | 489 | { |
| 478 | 490 | if (!$this->isFieldName($fieldName)) { |
@@ -487,6 +499,10 @@ discard block |
||
| 487 | 499 | return [$fieldName => $fieldValue]; |
| 488 | 500 | } |
| 489 | 501 | |
| 502 | + /** |
|
| 503 | + * @param string $fieldName |
|
| 504 | + * @param boolean $isAffected |
|
| 505 | + */ |
|
| 490 | 506 | private function setJsonValue($fieldName, $fieldValue, $isAffected) |
| 491 | 507 | { |
| 492 | 508 | $jsonFieldName = $fieldName . '__json'; |
@@ -692,6 +708,10 @@ discard block |
||
| 692 | 708 | return new $modelClass($row); |
| 693 | 709 | } |
| 694 | 710 | |
| 711 | + /** |
|
| 712 | + * @param string $fieldName |
|
| 713 | + * @param boolean $isAffected |
|
| 714 | + */ |
|
| 695 | 715 | private function setSpatialValue($fieldName, $fieldValue, $isAffected) |
| 696 | 716 | { |
| 697 | 717 | $geoFieldName = $fieldName . '__geo'; |
@@ -717,6 +737,10 @@ discard block |
||
| 717 | 737 | return [$geoFieldName => $fieldValue]; |
| 718 | 738 | } |
| 719 | 739 | |
| 740 | + /** |
|
| 741 | + * @param string $fieldName |
|
| 742 | + * @param boolean $isAffected |
|
| 743 | + */ |
|
| 720 | 744 | private function setFkValue($fieldName, $fieldValue, $isAffected) |
| 721 | 745 | { |
| 722 | 746 | $fkFieldName = $fieldName . '__fk'; |
@@ -1167,7 +1191,7 @@ discard block |
||
| 1167 | 1191 | |
| 1168 | 1192 | /** |
| 1169 | 1193 | * @param Model $modelClass |
| 1170 | - * @param $dataSourceKey |
|
| 1194 | + * @param string|null $dataSourceKey |
|
| 1171 | 1195 | */ |
| 1172 | 1196 | private function update($modelClass, $dataSourceKey) |
| 1173 | 1197 | { |
@@ -1207,8 +1231,8 @@ discard block |
||
| 1207 | 1231 | |
| 1208 | 1232 | /** |
| 1209 | 1233 | * @param Model $modelClass |
| 1210 | - * @param $isSmart |
|
| 1211 | - * @param $dataSourceKey |
|
| 1234 | + * @param boolean $isSmart |
|
| 1235 | + * @param string|null $dataSourceKey |
|
| 1212 | 1236 | */ |
| 1213 | 1237 | private function insert($modelClass, $isSmart, $dataSourceKey) |
| 1214 | 1238 | { |
@@ -1277,7 +1301,7 @@ discard block |
||
| 1277 | 1301 | /** |
| 1278 | 1302 | * Execute select from data source |
| 1279 | 1303 | * |
| 1280 | - * @param $fieldNames |
|
| 1304 | + * @param string $fieldNames |
|
| 1281 | 1305 | * @param string|null $dataSourceKey |
| 1282 | 1306 | * @param int $ttl |
| 1283 | 1307 | * @return Model|null |
@@ -1318,7 +1342,7 @@ discard block |
||
| 1318 | 1342 | * Execute delete for model |
| 1319 | 1343 | * |
| 1320 | 1344 | * @param string|null $dataSourceKey |
| 1321 | - * @return Model|null |
|
| 1345 | + * @return Model |
|
| 1322 | 1346 | * |
| 1323 | 1347 | * @author dp <[email protected]> |
| 1324 | 1348 | * |
@@ -1461,6 +1485,10 @@ discard block |
||
| 1461 | 1485 | : Query::getBuilder($selfModelClass)->pk($this->getPk()); |
| 1462 | 1486 | } |
| 1463 | 1487 | |
| 1488 | + /** |
|
| 1489 | + * @param Model $modelClass |
|
| 1490 | + * @param string $fieldNames |
|
| 1491 | + */ |
|
| 1464 | 1492 | public function fetchOne($modelClass, $fieldNames, $lazy = false) |
| 1465 | 1493 | { |
| 1466 | 1494 | $modelClass = Model::getClass($modelClass); |
@@ -9,15 +9,11 @@ |
||
| 9 | 9 | |
| 10 | 10 | namespace Ice\Core; |
| 11 | 11 | |
| 12 | -use Assetic\Test\Filter\PackerFilterTest; |
|
| 13 | 12 | use Ice\Core; |
| 14 | -use Ice\Helper\Arrays; |
|
| 15 | 13 | use Ice\Helper\Json; |
| 16 | 14 | use Ice\Helper\Model as Helper_Model; |
| 17 | 15 | use Ice\Helper\Object; |
| 18 | 16 | use Ice\Helper\Spatial; |
| 19 | -use Ice\Widget\Model_Form; |
|
| 20 | -use Ice\Widget\Model_Table; |
|
| 21 | 17 | |
| 22 | 18 | /** |
| 23 | 19 | * Class Model |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | /** |
| 39 | 39 | * Private constructor for model collection |
| 40 | 40 | * |
| 41 | - * @param $modelClass |
|
| 41 | + * @param Model $modelClass |
|
| 42 | 42 | * @param array $rows |
| 43 | 43 | * |
| 44 | 44 | * @author dp <[email protected]> |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | * Check table belongs to module |
| 79 | 79 | * |
| 80 | 80 | * @param $tableName |
| 81 | - * @param $dataSourceKey |
|
| 81 | + * @param string $dataSourceKey |
|
| 82 | 82 | * @return bool |
| 83 | 83 | * @author dp <[email protected]> |
| 84 | 84 | * |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | /** |
| 232 | 232 | * Load module configs |
| 233 | 233 | * |
| 234 | - * @param $vendor |
|
| 234 | + * @param string $vendor |
|
| 235 | 235 | * @param string $context |
| 236 | 236 | * @param array $modules |
| 237 | 237 | * |
@@ -10,7 +10,6 @@ |
||
| 10 | 10 | namespace Ice\Core; |
| 11 | 11 | |
| 12 | 12 | use Ice\Core; |
| 13 | -use Ice\Exception\ModuleNotFound; |
|
| 14 | 13 | use Ice\Helper\Directory; |
| 15 | 14 | use Ice\Helper\File; |
| 16 | 15 | use Ice\Helper\String; |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | * Create new instance of query |
| 79 | 79 | * |
| 80 | 80 | * @param QueryBuilder $queryBuilder |
| 81 | - * @param $dataSourceKey |
|
| 81 | + * @param string|null $dataSourceKey |
|
| 82 | 82 | * @return Query |
| 83 | 83 | * |
| 84 | 84 | * @author dp <[email protected]> |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | * @desc Результат запроса - единственная запись таблицы. |
| 404 | 404 | * |
| 405 | 405 | * @param null $pk |
| 406 | - * @param null $ttl |
|
| 406 | + * @param integer|null $ttl |
|
| 407 | 407 | * @return array|null |
| 408 | 408 | * @author dp <[email protected]> |
| 409 | 409 | * |
@@ -443,8 +443,8 @@ discard block |
||
| 443 | 443 | /** |
| 444 | 444 | * Return model from data |
| 445 | 445 | * |
| 446 | - * @param null $pk |
|
| 447 | - * @param null $ttl |
|
| 446 | + * @param null|string $pk |
|
| 447 | + * @param integer|null $ttl |
|
| 448 | 448 | * @return Model|null |
| 449 | 449 | * @author dp <[email protected]> |
| 450 | 450 | * |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | * @param array $fieldNameValues |
| 246 | 246 | * @param $sqlComparison |
| 247 | 247 | * @param array|string $modelTableData Key -> modelClass, value -> tableAlias |
| 248 | - * @param $isUse |
|
| 248 | + * @param boolean $isUse |
|
| 249 | 249 | * @return QueryBuilder |
| 250 | 250 | * @author dp <[email protected]> |
| 251 | 251 | * |
@@ -364,8 +364,8 @@ discard block |
||
| 364 | 364 | * |
| 365 | 365 | * @param Model $modelClass |
| 366 | 366 | * @param $fieldNames |
| 367 | - * @param $isValidate |
|
| 368 | - * @param $isInvalidate boolean |
|
| 367 | + * @param boolean $isValidate |
|
| 368 | + * @param boolean $isInvalidate boolean |
|
| 369 | 369 | * |
| 370 | 370 | * @author dp <[email protected]> |
| 371 | 371 | * |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | /** |
| 392 | 392 | * Set in query part where expression 'IS NULL' |
| 393 | 393 | * |
| 394 | - * @param $fieldName |
|
| 394 | + * @param string $fieldName |
|
| 395 | 395 | * @param array $modelTableData |
| 396 | 396 | * @param string $sqlLogical |
| 397 | 397 | * @param bool $isUse |
@@ -592,8 +592,8 @@ discard block |
||
| 592 | 592 | /** |
| 593 | 593 | * Set in query part where expression '> ?' |
| 594 | 594 | * |
| 595 | - * @param $fieldName |
|
| 596 | - * @param $fieldValue |
|
| 595 | + * @param string $fieldName |
|
| 596 | + * @param string $fieldValue |
|
| 597 | 597 | * @param array $modelTableData |
| 598 | 598 | * @param string $sqlLogical |
| 599 | 599 | * @param bool $isUse |
@@ -680,7 +680,7 @@ discard block |
||
| 680 | 680 | * |
| 681 | 681 | * @param $fieldName |
| 682 | 682 | * @param $fieldValue |
| 683 | - * @param array $modelTableData |
|
| 683 | + * @param string $modelTableData |
|
| 684 | 684 | * @param string $sqlLogical |
| 685 | 685 | * @param bool $isUse |
| 686 | 686 | * @return QueryBuilder |
@@ -728,7 +728,7 @@ discard block |
||
| 728 | 728 | /** |
| 729 | 729 | * Set in query part where expression '== 1' is boolean true(1) |
| 730 | 730 | * |
| 731 | - * @param $fieldName |
|
| 731 | + * @param string $fieldName |
|
| 732 | 732 | * @param array $modelTableData |
| 733 | 733 | * @param string $sqlLogical |
| 734 | 734 | * @return QueryBuilder |
@@ -764,8 +764,8 @@ discard block |
||
| 764 | 764 | /** |
| 765 | 765 | * Set in query part where expression 'like ?' |
| 766 | 766 | * |
| 767 | - * @param $fieldName |
|
| 768 | - * @param $fieldValue |
|
| 767 | + * @param string $fieldName |
|
| 768 | + * @param string $fieldValue |
|
| 769 | 769 | * @param array $modelTableData |
| 770 | 770 | * @param string $sqlLogical |
| 771 | 771 | * @param bool $isUse |
@@ -908,7 +908,7 @@ discard block |
||
| 908 | 908 | /** |
| 909 | 909 | * Return table alias for model class for query |
| 910 | 910 | * |
| 911 | - * @return Model |
|
| 911 | + * @return null|string |
|
| 912 | 912 | * |
| 913 | 913 | * @author dp <[email protected]> |
| 914 | 914 | * |
@@ -1287,7 +1287,7 @@ discard block |
||
| 1287 | 1287 | * |
| 1288 | 1288 | * @param array $data Key-value array |
| 1289 | 1289 | * @param $part |
| 1290 | - * @param $dataSourceKey |
|
| 1290 | + * @param string|null $dataSourceKey |
|
| 1291 | 1291 | * @return Query |
| 1292 | 1292 | * |
| 1293 | 1293 | * @author dp <[email protected]> |
@@ -1758,6 +1758,10 @@ discard block |
||
| 1758 | 1758 | return $this->addTrigger('afterSelect', $trigger, $params, $modelClass, $isUse); |
| 1759 | 1759 | } |
| 1760 | 1760 | |
| 1761 | + /** |
|
| 1762 | + * @param string $type |
|
| 1763 | + * @param boolean $isUse |
|
| 1764 | + */ |
|
| 1761 | 1765 | private function addTrigger($type, $trigger, $params, $modelClass, $isUse) |
| 1762 | 1766 | { |
| 1763 | 1767 | if (!$isUse) { |
@@ -1809,7 +1813,7 @@ discard block |
||
| 1809 | 1813 | } |
| 1810 | 1814 | |
| 1811 | 1815 | /** |
| 1812 | - * @param Widget[]|mixed $widgets |
|
| 1816 | + * @param string $widgets |
|
| 1813 | 1817 | * @param bool $applyWidgetQueryBuilderParts |
| 1814 | 1818 | * @return QueryBuilder |
| 1815 | 1819 | */ |
@@ -1877,7 +1881,7 @@ discard block |
||
| 1877 | 1881 | * Set query part limit |
| 1878 | 1882 | * |
| 1879 | 1883 | * @param $limit |
| 1880 | - * @param int|null $offset |
|
| 1884 | + * @param integer $offset |
|
| 1881 | 1885 | * @return QueryBuilder |
| 1882 | 1886 | * |
| 1883 | 1887 | * @author dp <[email protected]> |
@@ -13,7 +13,6 @@ |
||
| 13 | 13 | use Ice\Exception\Error; |
| 14 | 14 | use Ice\Exception\QueryBuilder_Join; |
| 15 | 15 | use Ice\Helper\Object; |
| 16 | -use Ice\QueryTranslator\Defined; |
|
| 17 | 16 | use Ice\Widget\Form; |
| 18 | 17 | |
| 19 | 18 | /** |
@@ -546,6 +546,9 @@ |
||
| 546 | 546 | return $string; |
| 547 | 547 | } |
| 548 | 548 | |
| 549 | + /** |
|
| 550 | + * @return integer |
|
| 551 | + */ |
|
| 549 | 552 | public function getFoundRows() |
| 550 | 553 | { |
| 551 | 554 | return $this->result[QueryResult::FOUND_ROWS]; |