@@ -30,8 +30,7 @@ |
||
| 30 | 30 | if (version_compare(PHP_VERSION, '5.3', '>=')) |
| 31 | 31 | { |
| 32 | 32 | error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED); |
| 33 | - } |
|
| 34 | - else |
|
| 33 | + } else |
|
| 35 | 34 | { |
| 36 | 35 | error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE); |
| 37 | 36 | } |
@@ -58,14 +58,14 @@ |
||
| 58 | 58 | Propel\Runtime\Propel::getServiceContainer()->setLogger('defaultLogger', $logger); |
| 59 | 59 | |
| 60 | 60 | $container->add(DebugBar\StandardDebugBar::class) |
| 61 | - ->withMethodCall("addCollector",[ |
|
| 62 | - new DebugBar\Bridge\Twig\TwigCollector( |
|
| 63 | - new DebugBar\Bridge\Twig\TraceableTwigEnvironment($container->get('Twig_Environment')) |
|
| 64 | - ) |
|
| 65 | - ]) |
|
| 66 | - ->withMethodCall("addCollector",[ |
|
| 67 | - new DebugBar\Bridge\Propel2Collector(Propel\Runtime\Propel::getConnection()) |
|
| 68 | - ]); |
|
| 61 | + ->withMethodCall("addCollector",[ |
|
| 62 | + new DebugBar\Bridge\Twig\TwigCollector( |
|
| 63 | + new DebugBar\Bridge\Twig\TraceableTwigEnvironment($container->get('Twig_Environment')) |
|
| 64 | + ) |
|
| 65 | + ]) |
|
| 66 | + ->withMethodCall("addCollector",[ |
|
| 67 | + new DebugBar\Bridge\Propel2Collector(Propel\Runtime\Propel::getConnection()) |
|
| 68 | + ]); |
|
| 69 | 69 | |
| 70 | 70 | |
| 71 | 71 | //Ропозиторий |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | { |
| 35 | 35 | error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE); |
| 36 | 36 | } |
| 37 | - $whoops->pushHandler(function () { |
|
| 37 | + $whoops->pushHandler(function() { |
|
| 38 | 38 | Response::create('Uh oh, something broke internally.', Response::HTTP_INTERNAL_SERVER_ERROR)->send(); |
| 39 | 39 | }); |
| 40 | 40 | } |
@@ -58,12 +58,12 @@ discard block |
||
| 58 | 58 | Propel\Runtime\Propel::getServiceContainer()->setLogger('defaultLogger', $logger); |
| 59 | 59 | |
| 60 | 60 | $container->add(DebugBar\StandardDebugBar::class) |
| 61 | - ->withMethodCall("addCollector",[ |
|
| 61 | + ->withMethodCall("addCollector", [ |
|
| 62 | 62 | new DebugBar\Bridge\Twig\TwigCollector( |
| 63 | 63 | new DebugBar\Bridge\Twig\TraceableTwigEnvironment($container->get('Twig_Environment')) |
| 64 | 64 | ) |
| 65 | 65 | ]) |
| 66 | - ->withMethodCall("addCollector",[ |
|
| 66 | + ->withMethodCall("addCollector", [ |
|
| 67 | 67 | new DebugBar\Bridge\Propel2Collector(Propel\Runtime\Propel::getConnection()) |
| 68 | 68 | ]); |
| 69 | 69 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | /** |
| 81 | 81 | * Routes |
| 82 | 82 | */ |
| 83 | -$dispatcher = FastRoute\simpleDispatcher(function (FastRoute\RouteCollector $r) { |
|
| 83 | +$dispatcher = FastRoute\simpleDispatcher(function(FastRoute\RouteCollector $r) { |
|
| 84 | 84 | $routes = require __DIR__ . '/routes.php'; |
| 85 | 85 | foreach ($routes as $route) { |
| 86 | 86 | $r->addRoute($route[0], $route[1], $route[2]); |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | use Twig_Environment; |
| 7 | 7 | use Core\Models\User\UserRepository; |
| 8 | 8 | use DebugBar\StandardDebugBar; |
| 9 | -use Frameworkless\Helpers\Debug; |
|
| 10 | 9 | |
| 11 | 10 | class IndexController |
| 12 | 11 | { |
@@ -23,23 +23,23 @@ discard block |
||
| 23 | 23 | protected $UserRepository; |
| 24 | 24 | |
| 25 | 25 | |
| 26 | - protected $debugbar; |
|
| 26 | + protected $debugbar; |
|
| 27 | 27 | |
| 28 | 28 | |
| 29 | - /** |
|
| 29 | + /** |
|
| 30 | 30 | * IndexController, constructed by container |
| 31 | 31 | * |
| 32 | 32 | * @param Twig_Environment $twig |
| 33 | 33 | */ |
| 34 | 34 | public function __construct( |
| 35 | - Twig_Environment $twig, |
|
| 36 | - UserRepository $UserRepository, |
|
| 37 | - StandardDebugBar $debugbar |
|
| 38 | - ) |
|
| 35 | + Twig_Environment $twig, |
|
| 36 | + UserRepository $UserRepository, |
|
| 37 | + StandardDebugBar $debugbar |
|
| 38 | + ) |
|
| 39 | 39 | { |
| 40 | 40 | $this->twig = $twig; |
| 41 | 41 | $this->UserRepository = $UserRepository; |
| 42 | - $this->debugbar = $debugbar; |
|
| 42 | + $this->debugbar = $debugbar; |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /** |
@@ -50,9 +50,9 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function get($args) |
| 52 | 52 | { |
| 53 | - $debugbarRenderer = $this->debugbar->getJavascriptRenderer("/assets/debug_bar"); |
|
| 53 | + $debugbarRenderer = $this->debugbar->getJavascriptRenderer("/assets/debug_bar"); |
|
| 54 | 54 | |
| 55 | - $this->debugbar["messages"]->addMessage("hello world!"); |
|
| 55 | + $this->debugbar["messages"]->addMessage("hello world!"); |
|
| 56 | 56 | |
| 57 | 57 | $Users = $this->UserRepository->findMany(); |
| 58 | 58 | |
@@ -75,8 +75,8 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | return new Response($this->twig->render('pages/index.html.twig', [ |
| 77 | 77 | "table" => $table->render(), |
| 78 | - "debugbar_Head" => $debugbarRenderer->renderHead(), |
|
| 79 | - "debugbar_Body" => $debugbarRenderer->render() |
|
| 78 | + "debugbar_Head" => $debugbarRenderer->renderHead(), |
|
| 79 | + "debugbar_Body" => $debugbarRenderer->render() |
|
| 80 | 80 | ])); |
| 81 | 81 | } |
| 82 | 82 | |
@@ -85,14 +85,14 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | |
| 87 | 87 | |
| 88 | - // $User = $this->UserRepository->build(); |
|
| 88 | + // $User = $this->UserRepository->build(); |
|
| 89 | 89 | //$User->setEmail('email.ru'); |
| 90 | 90 | //VarDumper::dump($User); |
| 91 | 91 | |
| 92 | 92 | try { |
| 93 | 93 | //$this->UserRepository->save($User); |
| 94 | 94 | |
| 95 | - //Faker |
|
| 95 | + //Faker |
|
| 96 | 96 | // $generator = \Faker\Factory::create(); |
| 97 | 97 | // $populator = new \Faker\ORM\Propel2\Populator($generator); |
| 98 | 98 | // $populator->addEntity('Core\Models\User\User', 5); |
@@ -102,7 +102,7 @@ |
||
| 102 | 102 | |
| 103 | 103 | |
| 104 | 104 | return new Response("success create!"); |
| 105 | - } catch(\Exception $ex) { |
|
| 105 | + } catch (\Exception $ex) { |
|
| 106 | 106 | return new Response("system error:" . $ex->getMessage()); |
| 107 | 107 | } |
| 108 | 108 | } |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | * |
| 290 | 290 | * @param string $msg |
| 291 | 291 | * @param int $priority One of the Propel::LOG_* logging levels |
| 292 | - * @return boolean |
|
| 292 | + * @return boolean|null |
|
| 293 | 293 | */ |
| 294 | 294 | protected function log($msg, $priority = Propel::LOG_INFO) |
| 295 | 295 | { |
@@ -1132,7 +1132,7 @@ discard block |
||
| 1132 | 1132 | * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM. |
| 1133 | 1133 | * The default key type is the column's TableMap::TYPE_PHPNAME. |
| 1134 | 1134 | * |
| 1135 | - * @param mixed $parser A AbstractParser instance, |
|
| 1135 | + * @param string $parser A AbstractParser instance, |
|
| 1136 | 1136 | * or a format name ('XML', 'YAML', 'JSON', 'CSV') |
| 1137 | 1137 | * @param string $data The source data to import from |
| 1138 | 1138 | * @param string $keyType The type of keys the array uses. |
@@ -11,7 +11,6 @@ |
||
| 11 | 11 | use Propel\Runtime\ActiveQuery\Criteria; |
| 12 | 12 | use Propel\Runtime\ActiveQuery\ModelCriteria; |
| 13 | 13 | use Propel\Runtime\ActiveRecord\ActiveRecordInterface; |
| 14 | -use Propel\Runtime\Collection\Collection; |
|
| 15 | 14 | use Propel\Runtime\Connection\ConnectionInterface; |
| 16 | 15 | use Propel\Runtime\Exception\BadMethodCallException; |
| 17 | 16 | use Propel\Runtime\Exception\LogicException; |
@@ -668,7 +668,7 @@ discard block |
||
| 668 | 668 | throw new PropelException('Cannot insert a value for auto-increment primary key (' . TaskTableMap::COL_ID . ')'); |
| 669 | 669 | } |
| 670 | 670 | |
| 671 | - // check the columns in natural order for more readable SQL queries |
|
| 671 | + // check the columns in natural order for more readable SQL queries |
|
| 672 | 672 | if ($this->isColumnModified(TaskTableMap::COL_ID)) { |
| 673 | 673 | $modifiedColumns[':p' . $index++] = 'id'; |
| 674 | 674 | } |
@@ -900,25 +900,25 @@ discard block |
||
| 900 | 900 | } |
| 901 | 901 | } |
| 902 | 902 | |
| 903 | - /** |
|
| 904 | - * Populate the current object from a string, using a given parser format |
|
| 905 | - * <code> |
|
| 906 | - * $book = new Book(); |
|
| 907 | - * $book->importFrom('JSON', '{"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}'); |
|
| 908 | - * </code> |
|
| 909 | - * |
|
| 910 | - * You can specify the key type of the array by additionally passing one |
|
| 911 | - * of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_CAMELNAME, |
|
| 912 | - * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM. |
|
| 913 | - * The default key type is the column's TableMap::TYPE_PHPNAME. |
|
| 914 | - * |
|
| 915 | - * @param mixed $parser A AbstractParser instance, |
|
| 916 | - * or a format name ('XML', 'YAML', 'JSON', 'CSV') |
|
| 917 | - * @param string $data The source data to import from |
|
| 918 | - * @param string $keyType The type of keys the array uses. |
|
| 919 | - * |
|
| 920 | - * @return $this|\Core\Models\Task\Task The current object, for fluid interface |
|
| 921 | - */ |
|
| 903 | + /** |
|
| 904 | + * Populate the current object from a string, using a given parser format |
|
| 905 | + * <code> |
|
| 906 | + * $book = new Book(); |
|
| 907 | + * $book->importFrom('JSON', '{"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}'); |
|
| 908 | + * </code> |
|
| 909 | + * |
|
| 910 | + * You can specify the key type of the array by additionally passing one |
|
| 911 | + * of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_CAMELNAME, |
|
| 912 | + * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM. |
|
| 913 | + * The default key type is the column's TableMap::TYPE_PHPNAME. |
|
| 914 | + * |
|
| 915 | + * @param mixed $parser A AbstractParser instance, |
|
| 916 | + * or a format name ('XML', 'YAML', 'JSON', 'CSV') |
|
| 917 | + * @param string $data The source data to import from |
|
| 918 | + * @param string $keyType The type of keys the array uses. |
|
| 919 | + * |
|
| 920 | + * @return $this|\Core\Models\Task\Task The current object, for fluid interface |
|
| 921 | + */ |
|
| 922 | 922 | public function importFrom($parser, $data, $keyType = TableMap::TYPE_PHPNAME) |
| 923 | 923 | { |
| 924 | 924 | if (!$parser instanceof AbstractParser) { |
@@ -711,7 +711,7 @@ discard block |
||
| 711 | 711 | $con = Propel::getServiceContainer()->getWriteConnection(UserTableMap::DATABASE_NAME); |
| 712 | 712 | } |
| 713 | 713 | |
| 714 | - $con->transaction(function () use ($con) { |
|
| 714 | + $con->transaction(function() use ($con) { |
|
| 715 | 715 | $deleteQuery = ChildUserQuery::create() |
| 716 | 716 | ->filterByPrimaryKey($this->getPrimaryKey()); |
| 717 | 717 | $ret = $this->preDelete($con); |
@@ -746,7 +746,7 @@ discard block |
||
| 746 | 746 | $con = Propel::getServiceContainer()->getWriteConnection(UserTableMap::DATABASE_NAME); |
| 747 | 747 | } |
| 748 | 748 | |
| 749 | - return $con->transaction(function () use ($con) { |
|
| 749 | + return $con->transaction(function() use ($con) { |
|
| 750 | 750 | $isInsert = $this->isNew(); |
| 751 | 751 | $ret = $this->preSave($con); |
| 752 | 752 | if ($isInsert) { |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | * |
| 317 | 317 | * @param string $msg |
| 318 | 318 | * @param int $priority One of the Propel::LOG_* logging levels |
| 319 | - * @return boolean |
|
| 319 | + * @return boolean|null |
|
| 320 | 320 | */ |
| 321 | 321 | protected function log($msg, $priority = Propel::LOG_INFO) |
| 322 | 322 | { |
@@ -1159,7 +1159,7 @@ discard block |
||
| 1159 | 1159 | * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM. |
| 1160 | 1160 | * The default key type is the column's TableMap::TYPE_PHPNAME. |
| 1161 | 1161 | * |
| 1162 | - * @param mixed $parser A AbstractParser instance, |
|
| 1162 | + * @param string $parser A AbstractParser instance, |
|
| 1163 | 1163 | * or a format name ('XML', 'YAML', 'JSON', 'CSV') |
| 1164 | 1164 | * @param string $data The source data to import from |
| 1165 | 1165 | * @param string $keyType The type of keys the array uses. |
@@ -1390,7 +1390,7 @@ discard block |
||
| 1390 | 1390 | * Validates the object and all objects related to this table. |
| 1391 | 1391 | * |
| 1392 | 1392 | * @see getValidationFailures() |
| 1393 | - * @param object $validator A Validator class instance |
|
| 1393 | + * @param ValidatorInterface $validator A Validator class instance |
|
| 1394 | 1394 | * @return boolean Whether all objects pass validation. |
| 1395 | 1395 | */ |
| 1396 | 1396 | public function validate(ValidatorInterface $validator = null) |
@@ -1437,7 +1437,7 @@ discard block |
||
| 1437 | 1437 | * Gets any ConstraintViolation objects that resulted from last call to validate(). |
| 1438 | 1438 | * |
| 1439 | 1439 | * |
| 1440 | - * @return object ConstraintViolationList |
|
| 1440 | + * @return ConstraintViolationList ConstraintViolationList |
|
| 1441 | 1441 | * @see validate() |
| 1442 | 1442 | */ |
| 1443 | 1443 | public function getValidationFailures() |
@@ -11,7 +11,6 @@ |
||
| 11 | 11 | use Propel\Runtime\ActiveQuery\Criteria; |
| 12 | 12 | use Propel\Runtime\ActiveQuery\ModelCriteria; |
| 13 | 13 | use Propel\Runtime\ActiveRecord\ActiveRecordInterface; |
| 14 | -use Propel\Runtime\Collection\Collection; |
|
| 15 | 14 | use Propel\Runtime\Connection\ConnectionInterface; |
| 16 | 15 | use Propel\Runtime\Exception\BadMethodCallException; |
| 17 | 16 | use Propel\Runtime\Exception\LogicException; |
@@ -851,7 +851,7 @@ discard block |
||
| 851 | 851 | throw new PropelException('Cannot insert a value for auto-increment primary key (' . UserTableMap::COL_ID . ')'); |
| 852 | 852 | } |
| 853 | 853 | |
| 854 | - // check the columns in natural order for more readable SQL queries |
|
| 854 | + // check the columns in natural order for more readable SQL queries |
|
| 855 | 855 | if ($this->isColumnModified(UserTableMap::COL_ID)) { |
| 856 | 856 | $modifiedColumns[':p' . $index++] = 'id'; |
| 857 | 857 | } |
@@ -1147,25 +1147,25 @@ discard block |
||
| 1147 | 1147 | } |
| 1148 | 1148 | } |
| 1149 | 1149 | |
| 1150 | - /** |
|
| 1151 | - * Populate the current object from a string, using a given parser format |
|
| 1152 | - * <code> |
|
| 1153 | - * $book = new Book(); |
|
| 1154 | - * $book->importFrom('JSON', '{"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}'); |
|
| 1155 | - * </code> |
|
| 1156 | - * |
|
| 1157 | - * You can specify the key type of the array by additionally passing one |
|
| 1158 | - * of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_CAMELNAME, |
|
| 1159 | - * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM. |
|
| 1160 | - * The default key type is the column's TableMap::TYPE_PHPNAME. |
|
| 1161 | - * |
|
| 1162 | - * @param mixed $parser A AbstractParser instance, |
|
| 1163 | - * or a format name ('XML', 'YAML', 'JSON', 'CSV') |
|
| 1164 | - * @param string $data The source data to import from |
|
| 1165 | - * @param string $keyType The type of keys the array uses. |
|
| 1166 | - * |
|
| 1167 | - * @return $this|\Core\Models\User\User The current object, for fluid interface |
|
| 1168 | - */ |
|
| 1150 | + /** |
|
| 1151 | + * Populate the current object from a string, using a given parser format |
|
| 1152 | + * <code> |
|
| 1153 | + * $book = new Book(); |
|
| 1154 | + * $book->importFrom('JSON', '{"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}'); |
|
| 1155 | + * </code> |
|
| 1156 | + * |
|
| 1157 | + * You can specify the key type of the array by additionally passing one |
|
| 1158 | + * of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_CAMELNAME, |
|
| 1159 | + * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM. |
|
| 1160 | + * The default key type is the column's TableMap::TYPE_PHPNAME. |
|
| 1161 | + * |
|
| 1162 | + * @param mixed $parser A AbstractParser instance, |
|
| 1163 | + * or a format name ('XML', 'YAML', 'JSON', 'CSV') |
|
| 1164 | + * @param string $data The source data to import from |
|
| 1165 | + * @param string $keyType The type of keys the array uses. |
|
| 1166 | + * |
|
| 1167 | + * @return $this|\Core\Models\User\User The current object, for fluid interface |
|
| 1168 | + */ |
|
| 1169 | 1169 | public function importFrom($parser, $data, $keyType = TableMap::TYPE_PHPNAME) |
| 1170 | 1170 | { |
| 1171 | 1171 | if (!$parser instanceof AbstractParser) { |
@@ -738,7 +738,7 @@ discard block |
||
| 738 | 738 | $con = Propel::getServiceContainer()->getWriteConnection(UserTableMap::DATABASE_NAME); |
| 739 | 739 | } |
| 740 | 740 | |
| 741 | - $con->transaction(function () use ($con) { |
|
| 741 | + $con->transaction(function() use ($con) { |
|
| 742 | 742 | $deleteQuery = ChildUserQuery::create() |
| 743 | 743 | ->filterByPrimaryKey($this->getPrimaryKey()); |
| 744 | 744 | $ret = $this->preDelete($con); |
@@ -773,7 +773,7 @@ discard block |
||
| 773 | 773 | $con = Propel::getServiceContainer()->getWriteConnection(UserTableMap::DATABASE_NAME); |
| 774 | 774 | } |
| 775 | 775 | |
| 776 | - return $con->transaction(function () use ($con) { |
|
| 776 | + return $con->transaction(function() use ($con) { |
|
| 777 | 777 | $isInsert = $this->isNew(); |
| 778 | 778 | $ret = $this->preSave($con); |
| 779 | 779 | if ($isInsert) { |
@@ -1396,13 +1396,13 @@ discard block |
||
| 1396 | 1396 | public function validate(ValidatorInterface $validator = null) |
| 1397 | 1397 | { |
| 1398 | 1398 | if (null === $validator) { |
| 1399 | - if(class_exists('Symfony\\Component\\Validator\\Validator\\LegacyValidator')){ |
|
| 1399 | + if (class_exists('Symfony\\Component\\Validator\\Validator\\LegacyValidator')) { |
|
| 1400 | 1400 | $validator = new LegacyValidator( |
| 1401 | 1401 | new ExecutionContextFactory(new DefaultTranslator()), |
| 1402 | 1402 | new ClassMetaDataFactory(new StaticMethodLoader()), |
| 1403 | 1403 | new ConstraintValidatorFactory() |
| 1404 | 1404 | ); |
| 1405 | - }else{ |
|
| 1405 | + } else { |
|
| 1406 | 1406 | $validator = new Validator( |
| 1407 | 1407 | new ClassMetadataFactory(new StaticMethodLoader()), |
| 1408 | 1408 | new ConstraintValidatorFactory(), |
@@ -1402,7 +1402,7 @@ |
||
| 1402 | 1402 | new ClassMetaDataFactory(new StaticMethodLoader()), |
| 1403 | 1403 | new ConstraintValidatorFactory() |
| 1404 | 1404 | ); |
| 1405 | - }else{ |
|
| 1405 | + } else{ |
|
| 1406 | 1406 | $validator = new Validator( |
| 1407 | 1407 | new ClassMetadataFactory(new StaticMethodLoader()), |
| 1408 | 1408 | new ConstraintValidatorFactory(), |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | |
| 69 | 69 | /** |
| 70 | 70 | * |
| 71 | - * @return \Models\User\Models\User\User $User |
|
| 71 | + * @return User $User |
|
| 72 | 72 | */ |
| 73 | 73 | public function build(){ |
| 74 | 74 | return new User; |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace Models\User; |
| 4 | 4 | |
| 5 | 5 | use Propel\Runtime\ActiveRecord\ActiveRecordInterface; |
| 6 | - |
|
| 7 | 6 | use Models\User\User; |
| 8 | 7 | use Models\User\UserQuery; |
| 9 | 8 | |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | public function findById($id) |
| 30 | 30 | { |
| 31 | 31 | if (!$User = UserQuery::create()->findPk($id)) { |
| 32 | - throw new \InvalidArgumentException(sprintf('User with ID %d does not exist',$id)); |
|
| 32 | + throw new \InvalidArgumentException(sprintf('User with ID %d does not exist', $id)); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | return $User; |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | |
| 62 | 62 | if (!$Model->save()) { |
| 63 | - throw new \DomainException(sprintf('User not save',$id)); |
|
| 63 | + throw new \DomainException(sprintf('User not save', $id)); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | return true; |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | * |
| 71 | 71 | * @return \Models\User\Models\User\User $User |
| 72 | 72 | */ |
| 73 | - public function build(){ |
|
| 73 | + public function build() { |
|
| 74 | 74 | return new User; |
| 75 | 75 | } |
| 76 | 76 | |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | * |
| 290 | 290 | * @param string $msg |
| 291 | 291 | * @param int $priority One of the Propel::LOG_* logging levels |
| 292 | - * @return boolean |
|
| 292 | + * @return boolean|null |
|
| 293 | 293 | */ |
| 294 | 294 | protected function log($msg, $priority = Propel::LOG_INFO) |
| 295 | 295 | { |
@@ -1132,7 +1132,7 @@ discard block |
||
| 1132 | 1132 | * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM. |
| 1133 | 1133 | * The default key type is the column's TableMap::TYPE_PHPNAME. |
| 1134 | 1134 | * |
| 1135 | - * @param mixed $parser A AbstractParser instance, |
|
| 1135 | + * @param string $parser A AbstractParser instance, |
|
| 1136 | 1136 | * or a format name ('XML', 'YAML', 'JSON', 'CSV') |
| 1137 | 1137 | * @param string $data The source data to import from |
| 1138 | 1138 | * @param string $keyType The type of keys the array uses. |
@@ -11,7 +11,6 @@ |
||
| 11 | 11 | use Propel\Runtime\ActiveQuery\Criteria; |
| 12 | 12 | use Propel\Runtime\ActiveQuery\ModelCriteria; |
| 13 | 13 | use Propel\Runtime\ActiveRecord\ActiveRecordInterface; |
| 14 | -use Propel\Runtime\Collection\Collection; |
|
| 15 | 14 | use Propel\Runtime\Connection\ConnectionInterface; |
| 16 | 15 | use Propel\Runtime\Exception\BadMethodCallException; |
| 17 | 16 | use Propel\Runtime\Exception\LogicException; |
@@ -694,7 +694,7 @@ discard block |
||
| 694 | 694 | throw new PropelException('Cannot insert a value for auto-increment primary key (' . SelfpriceTableMap::COL_ID . ')'); |
| 695 | 695 | } |
| 696 | 696 | |
| 697 | - // check the columns in natural order for more readable SQL queries |
|
| 697 | + // check the columns in natural order for more readable SQL queries |
|
| 698 | 698 | if ($this->isColumnModified(SelfpriceTableMap::COL_ID)) { |
| 699 | 699 | $modifiedColumns[':p' . $index++] = 'id'; |
| 700 | 700 | } |
@@ -936,25 +936,25 @@ discard block |
||
| 936 | 936 | } |
| 937 | 937 | } |
| 938 | 938 | |
| 939 | - /** |
|
| 940 | - * Populate the current object from a string, using a given parser format |
|
| 941 | - * <code> |
|
| 942 | - * $book = new Book(); |
|
| 943 | - * $book->importFrom('JSON', '{"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}'); |
|
| 944 | - * </code> |
|
| 945 | - * |
|
| 946 | - * You can specify the key type of the array by additionally passing one |
|
| 947 | - * of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_CAMELNAME, |
|
| 948 | - * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM. |
|
| 949 | - * The default key type is the column's TableMap::TYPE_PHPNAME. |
|
| 950 | - * |
|
| 951 | - * @param mixed $parser A AbstractParser instance, |
|
| 952 | - * or a format name ('XML', 'YAML', 'JSON', 'CSV') |
|
| 953 | - * @param string $data The source data to import from |
|
| 954 | - * @param string $keyType The type of keys the array uses. |
|
| 955 | - * |
|
| 956 | - * @return $this|\Selfprice\Models\Selfprice\Selfprice The current object, for fluid interface |
|
| 957 | - */ |
|
| 939 | + /** |
|
| 940 | + * Populate the current object from a string, using a given parser format |
|
| 941 | + * <code> |
|
| 942 | + * $book = new Book(); |
|
| 943 | + * $book->importFrom('JSON', '{"Id":9012,"Title":"Don Juan","ISBN":"0140422161","Price":12.99,"PublisherId":1234,"AuthorId":5678}'); |
|
| 944 | + * </code> |
|
| 945 | + * |
|
| 946 | + * You can specify the key type of the array by additionally passing one |
|
| 947 | + * of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_CAMELNAME, |
|
| 948 | + * TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM. |
|
| 949 | + * The default key type is the column's TableMap::TYPE_PHPNAME. |
|
| 950 | + * |
|
| 951 | + * @param mixed $parser A AbstractParser instance, |
|
| 952 | + * or a format name ('XML', 'YAML', 'JSON', 'CSV') |
|
| 953 | + * @param string $data The source data to import from |
|
| 954 | + * @param string $keyType The type of keys the array uses. |
|
| 955 | + * |
|
| 956 | + * @return $this|\Selfprice\Models\Selfprice\Selfprice The current object, for fluid interface |
|
| 957 | + */ |
|
| 958 | 958 | public function importFrom($parser, $data, $keyType = TableMap::TYPE_PHPNAME) |
| 959 | 959 | { |
| 960 | 960 | if (!$parser instanceof AbstractParser) { |
@@ -711,7 +711,7 @@ discard block |
||
| 711 | 711 | $con = Propel::getServiceContainer()->getWriteConnection(UserTableMap::DATABASE_NAME); |
| 712 | 712 | } |
| 713 | 713 | |
| 714 | - $con->transaction(function () use ($con) { |
|
| 714 | + $con->transaction(function() use ($con) { |
|
| 715 | 715 | $deleteQuery = ChildUserQuery::create() |
| 716 | 716 | ->filterByPrimaryKey($this->getPrimaryKey()); |
| 717 | 717 | $ret = $this->preDelete($con); |
@@ -746,7 +746,7 @@ discard block |
||
| 746 | 746 | $con = Propel::getServiceContainer()->getWriteConnection(UserTableMap::DATABASE_NAME); |
| 747 | 747 | } |
| 748 | 748 | |
| 749 | - return $con->transaction(function () use ($con) { |
|
| 749 | + return $con->transaction(function() use ($con) { |
|
| 750 | 750 | $isInsert = $this->isNew(); |
| 751 | 751 | $ret = $this->preSave($con); |
| 752 | 752 | if ($isInsert) { |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | //var_dump($file->getRelativePathname()); |
| 26 | 26 | |
| 27 | 27 | if (!copy($file->getRealpath(), $root_path . '/db/' . $file->getRelativePathname())) { |
| 28 | - echo sprintf("error copy migration %s..." . PHP_EOL, $file->getRelativePathname()); |
|
| 28 | + echo sprintf("error copy migration %s..." . PHP_EOL, $file->getRelativePathname()); |
|
| 29 | 29 | } |
| 30 | 30 | else{ |
| 31 | 31 | echo sprintf("copy migration %s" . PHP_EOL, $file->getRelativePathname()); |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | if (!copy($file->getRealpath(), $root_path . '/db/' . $file->getRelativePathname())) { |
| 28 | 28 | echo sprintf("error copy migration %s..." . PHP_EOL, $file->getRelativePathname()); |
| 29 | 29 | } |
| 30 | - else{ |
|
| 30 | + else { |
|
| 31 | 31 | echo sprintf("copy migration %s" . PHP_EOL, $file->getRelativePathname()); |
| 32 | 32 | } |
| 33 | 33 | } |
@@ -26,8 +26,7 @@ |
||
| 26 | 26 | |
| 27 | 27 | if (!copy($file->getRealpath(), $root_path . '/db/' . $file->getRelativePathname())) { |
| 28 | 28 | echo sprintf("error copy migration %s..." . PHP_EOL, $file->getRelativePathname()); |
| 29 | - } |
|
| 30 | - else{ |
|
| 29 | + } else{ |
|
| 31 | 30 | echo sprintf("copy migration %s" . PHP_EOL, $file->getRelativePathname()); |
| 32 | 31 | } |
| 33 | 32 | } |
@@ -49,7 +49,6 @@ |
||
| 49 | 49 | * @method ChildUser findOneByRememberToken(string $remember_token) Return the first ChildUser filtered by the remember_token column |
| 50 | 50 | * @method ChildUser findOneByCreatedAt(string $created_at) Return the first ChildUser filtered by the created_at column |
| 51 | 51 | * @method ChildUser findOneByUpdatedAt(string $updated_at) Return the first ChildUser filtered by the updated_at column * |
| 52 | - |
|
| 53 | 52 | * @method ChildUser requirePk($key, ConnectionInterface $con = null) Return the ChildUser by primary key and throws \Propel\Runtime\Exception\EntityNotFoundException when not found |
| 54 | 53 | * @method ChildUser requireOne(ConnectionInterface $con = null) Return the first ChildUser matching the query and throws \Propel\Runtime\Exception\EntityNotFoundException when not found |
| 55 | 54 | * |
@@ -524,7 +524,7 @@ discard block |
||
| 524 | 524 | |
| 525 | 525 | // use transaction because $criteria could contain info |
| 526 | 526 | // for more than one table or we could emulating ON DELETE CASCADE, etc. |
| 527 | - return $con->transaction(function () use ($con) { |
|
| 527 | + return $con->transaction(function() use ($con) { |
|
| 528 | 528 | $affectedRows = 0; // initialize var to track total num of affected rows |
| 529 | 529 | $affectedRows += parent::doDeleteAll($con); |
| 530 | 530 | // Because this db requires some delete cascade/set null emulation, we have to |
@@ -559,7 +559,7 @@ discard block |
||
| 559 | 559 | |
| 560 | 560 | // use transaction because $criteria could contain info |
| 561 | 561 | // for more than one table or we could emulating ON DELETE CASCADE, etc. |
| 562 | - return $con->transaction(function () use ($con, $criteria) { |
|
| 562 | + return $con->transaction(function() use ($con, $criteria) { |
|
| 563 | 563 | $affectedRows = 0; // initialize var to track total num of affected rows |
| 564 | 564 | |
| 565 | 565 | UserTableMap::removeInstanceFromPool($criteria); |
@@ -365,8 +365,8 @@ |
||
| 365 | 365 | * @throws PropelException Any exceptions caught during processing will be |
| 366 | 366 | * rethrown wrapped into a PropelException. |
| 367 | 367 | */ |
| 368 | - public static function doDelete($values, ConnectionInterface $con = null) |
|
| 369 | - { |
|
| 368 | + public static function doDelete($values, ConnectionInterface $con = null) |
|
| 369 | + { |
|
| 370 | 370 | if (null === $con) { |
| 371 | 371 | $con = Propel::getServiceContainer()->getWriteConnection(UserTableMap::DATABASE_NAME); |
| 372 | 372 | } |
@@ -97,12 +97,12 @@ discard block |
||
| 97 | 97 | * first dimension keys are the type constants |
| 98 | 98 | * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' |
| 99 | 99 | */ |
| 100 | - protected static $fieldNames = array ( |
|
| 101 | - self::TYPE_PHPNAME => array('Id', 'CreatedAt', 'UpdatedAt', ), |
|
| 102 | - self::TYPE_CAMELNAME => array('id', 'createdAt', 'updatedAt', ), |
|
| 103 | - self::TYPE_COLNAME => array(TaskTableMap::COL_ID, TaskTableMap::COL_CREATED_AT, TaskTableMap::COL_UPDATED_AT, ), |
|
| 104 | - self::TYPE_FIELDNAME => array('id', 'created_at', 'updated_at', ), |
|
| 105 | - self::TYPE_NUM => array(0, 1, 2, ) |
|
| 100 | + protected static $fieldNames = array( |
|
| 101 | + self::TYPE_PHPNAME => array('Id', 'CreatedAt', 'UpdatedAt',), |
|
| 102 | + self::TYPE_CAMELNAME => array('id', 'createdAt', 'updatedAt',), |
|
| 103 | + self::TYPE_COLNAME => array(TaskTableMap::COL_ID, TaskTableMap::COL_CREATED_AT, TaskTableMap::COL_UPDATED_AT,), |
|
| 104 | + self::TYPE_FIELDNAME => array('id', 'created_at', 'updated_at',), |
|
| 105 | + self::TYPE_NUM => array(0, 1, 2,) |
|
| 106 | 106 | ); |
| 107 | 107 | |
| 108 | 108 | /** |
@@ -111,12 +111,12 @@ discard block |
||
| 111 | 111 | * first dimension keys are the type constants |
| 112 | 112 | * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0 |
| 113 | 113 | */ |
| 114 | - protected static $fieldKeys = array ( |
|
| 115 | - self::TYPE_PHPNAME => array('Id' => 0, 'CreatedAt' => 1, 'UpdatedAt' => 2, ), |
|
| 116 | - self::TYPE_CAMELNAME => array('id' => 0, 'createdAt' => 1, 'updatedAt' => 2, ), |
|
| 117 | - self::TYPE_COLNAME => array(TaskTableMap::COL_ID => 0, TaskTableMap::COL_CREATED_AT => 1, TaskTableMap::COL_UPDATED_AT => 2, ), |
|
| 118 | - self::TYPE_FIELDNAME => array('id' => 0, 'created_at' => 1, 'updated_at' => 2, ), |
|
| 119 | - self::TYPE_NUM => array(0, 1, 2, ) |
|
| 114 | + protected static $fieldKeys = array( |
|
| 115 | + self::TYPE_PHPNAME => array('Id' => 0, 'CreatedAt' => 1, 'UpdatedAt' => 2,), |
|
| 116 | + self::TYPE_CAMELNAME => array('id' => 0, 'createdAt' => 1, 'updatedAt' => 2,), |
|
| 117 | + self::TYPE_COLNAME => array(TaskTableMap::COL_ID => 0, TaskTableMap::COL_CREATED_AT => 1, TaskTableMap::COL_UPDATED_AT => 2,), |
|
| 118 | + self::TYPE_FIELDNAME => array('id' => 0, 'created_at' => 1, 'updated_at' => 2,), |
|
| 119 | + self::TYPE_NUM => array(0, 1, 2,) |
|
| 120 | 120 | ); |
| 121 | 121 | |
| 122 | 122 | /** |
@@ -395,8 +395,8 @@ discard block |
||
| 395 | 395 | $criteria = $criteria->buildCriteria(); // build Criteria from Task object |
| 396 | 396 | } |
| 397 | 397 | |
| 398 | - if ($criteria->containsKey(TaskTableMap::COL_ID) && $criteria->keyContainsValue(TaskTableMap::COL_ID) ) { |
|
| 399 | - throw new PropelException('Cannot insert a value for auto-increment primary key ('.TaskTableMap::COL_ID.')'); |
|
| 398 | + if ($criteria->containsKey(TaskTableMap::COL_ID) && $criteria->keyContainsValue(TaskTableMap::COL_ID)) { |
|
| 399 | + throw new PropelException('Cannot insert a value for auto-increment primary key (' . TaskTableMap::COL_ID . ')'); |
|
| 400 | 400 | } |
| 401 | 401 | |
| 402 | 402 | |
@@ -405,7 +405,7 @@ discard block |
||
| 405 | 405 | |
| 406 | 406 | // use transaction because $criteria could contain info |
| 407 | 407 | // for more than one table (I guess, conceivably) |
| 408 | - return $con->transaction(function () use ($con, $query) { |
|
| 408 | + return $con->transaction(function() use ($con, $query) { |
|
| 409 | 409 | return $query->doInsert($con); |
| 410 | 410 | }); |
| 411 | 411 | } |