@@ -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 | } |
@@ -102,12 +102,12 @@ discard block |
||
102 | 102 | * first dimension keys are the type constants |
103 | 103 | * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' |
104 | 104 | */ |
105 | - protected static $fieldNames = array ( |
|
106 | - self::TYPE_PHPNAME => array('Id', 'Name', 'Datecreate', 'Desc', ), |
|
107 | - self::TYPE_CAMELNAME => array('id', 'name', 'datecreate', 'desc', ), |
|
108 | - self::TYPE_COLNAME => array(SelfpriceTableMap::COL_ID, SelfpriceTableMap::COL_NAME, SelfpriceTableMap::COL_DATECREATE, SelfpriceTableMap::COL_DESC, ), |
|
109 | - self::TYPE_FIELDNAME => array('id', 'name', 'datecreate', 'desc', ), |
|
110 | - self::TYPE_NUM => array(0, 1, 2, 3, ) |
|
105 | + protected static $fieldNames = array( |
|
106 | + self::TYPE_PHPNAME => array('Id', 'Name', 'Datecreate', 'Desc',), |
|
107 | + self::TYPE_CAMELNAME => array('id', 'name', 'datecreate', 'desc',), |
|
108 | + self::TYPE_COLNAME => array(SelfpriceTableMap::COL_ID, SelfpriceTableMap::COL_NAME, SelfpriceTableMap::COL_DATECREATE, SelfpriceTableMap::COL_DESC,), |
|
109 | + self::TYPE_FIELDNAME => array('id', 'name', 'datecreate', 'desc',), |
|
110 | + self::TYPE_NUM => array(0, 1, 2, 3,) |
|
111 | 111 | ); |
112 | 112 | |
113 | 113 | /** |
@@ -116,12 +116,12 @@ discard block |
||
116 | 116 | * first dimension keys are the type constants |
117 | 117 | * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0 |
118 | 118 | */ |
119 | - protected static $fieldKeys = array ( |
|
120 | - self::TYPE_PHPNAME => array('Id' => 0, 'Name' => 1, 'Datecreate' => 2, 'Desc' => 3, ), |
|
121 | - self::TYPE_CAMELNAME => array('id' => 0, 'name' => 1, 'datecreate' => 2, 'desc' => 3, ), |
|
122 | - self::TYPE_COLNAME => array(SelfpriceTableMap::COL_ID => 0, SelfpriceTableMap::COL_NAME => 1, SelfpriceTableMap::COL_DATECREATE => 2, SelfpriceTableMap::COL_DESC => 3, ), |
|
123 | - self::TYPE_FIELDNAME => array('id' => 0, 'name' => 1, 'datecreate' => 2, 'desc' => 3, ), |
|
124 | - self::TYPE_NUM => array(0, 1, 2, 3, ) |
|
119 | + protected static $fieldKeys = array( |
|
120 | + self::TYPE_PHPNAME => array('Id' => 0, 'Name' => 1, 'Datecreate' => 2, 'Desc' => 3,), |
|
121 | + self::TYPE_CAMELNAME => array('id' => 0, 'name' => 1, 'datecreate' => 2, 'desc' => 3,), |
|
122 | + self::TYPE_COLNAME => array(SelfpriceTableMap::COL_ID => 0, SelfpriceTableMap::COL_NAME => 1, SelfpriceTableMap::COL_DATECREATE => 2, SelfpriceTableMap::COL_DESC => 3,), |
|
123 | + self::TYPE_FIELDNAME => array('id' => 0, 'name' => 1, 'datecreate' => 2, 'desc' => 3,), |
|
124 | + self::TYPE_NUM => array(0, 1, 2, 3,) |
|
125 | 125 | ); |
126 | 126 | |
127 | 127 | /** |
@@ -403,8 +403,8 @@ discard block |
||
403 | 403 | $criteria = $criteria->buildCriteria(); // build Criteria from Selfprice object |
404 | 404 | } |
405 | 405 | |
406 | - if ($criteria->containsKey(SelfpriceTableMap::COL_ID) && $criteria->keyContainsValue(SelfpriceTableMap::COL_ID) ) { |
|
407 | - throw new PropelException('Cannot insert a value for auto-increment primary key ('.SelfpriceTableMap::COL_ID.')'); |
|
406 | + if ($criteria->containsKey(SelfpriceTableMap::COL_ID) && $criteria->keyContainsValue(SelfpriceTableMap::COL_ID)) { |
|
407 | + throw new PropelException('Cannot insert a value for auto-increment primary key (' . SelfpriceTableMap::COL_ID . ')'); |
|
408 | 408 | } |
409 | 409 | |
410 | 410 | |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | |
414 | 414 | // use transaction because $criteria could contain info |
415 | 415 | // for more than one table (I guess, conceivably) |
416 | - return $con->transaction(function () use ($con, $query) { |
|
416 | + return $con->transaction(function() use ($con, $query) { |
|
417 | 417 | return $query->doInsert($con); |
418 | 418 | }); |
419 | 419 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | public function getUpSQL() |
39 | 39 | { |
40 | 40 | return array ( |
41 | - 'default' => ' |
|
41 | + 'default' => ' |
|
42 | 42 | # This is a fix for InnoDB in MySQL >= 4.1.x |
43 | 43 | # It "suspends judgement" for fkey relationships until are tables are set. |
44 | 44 | SET FOREIGN_KEY_CHECKS = 0; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | public function getDownSQL() |
69 | 69 | { |
70 | 70 | return array ( |
71 | - 'default' => ' |
|
71 | + 'default' => ' |
|
72 | 72 | # This is a fix for InnoDB in MySQL >= 4.1.x |
73 | 73 | # It "suspends judgement" for fkey relationships until are tables are set. |
74 | 74 | SET FOREIGN_KEY_CHECKS = 0; |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function getUpSQL() |
39 | 39 | { |
40 | - return array ( |
|
40 | + return array( |
|
41 | 41 | 'default' => ' |
42 | 42 | # This is a fix for InnoDB in MySQL >= 4.1.x |
43 | 43 | # It "suspends judgement" for fkey relationships until are tables are set. |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | */ |
68 | 68 | public function getDownSQL() |
69 | 69 | { |
70 | - return array ( |
|
70 | + return array( |
|
71 | 71 | 'default' => ' |
72 | 72 | # This is a fix for InnoDB in MySQL >= 4.1.x |
73 | 73 | # It "suspends judgement" for fkey relationships until are tables are set. |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | public function getUpSQL() |
39 | 39 | { |
40 | 40 | return array ( |
41 | - 'default' => ' |
|
41 | + 'default' => ' |
|
42 | 42 | # This is a fix for InnoDB in MySQL >= 4.1.x |
43 | 43 | # It "suspends judgement" for fkey relationships until are tables are set. |
44 | 44 | SET FOREIGN_KEY_CHECKS = 0; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | public function getDownSQL() |
69 | 69 | { |
70 | 70 | return array ( |
71 | - 'default' => ' |
|
71 | + 'default' => ' |
|
72 | 72 | # This is a fix for InnoDB in MySQL >= 4.1.x |
73 | 73 | # It "suspends judgement" for fkey relationships until are tables are set. |
74 | 74 | SET FOREIGN_KEY_CHECKS = 0; |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function getUpSQL() |
39 | 39 | { |
40 | - return array ( |
|
40 | + return array( |
|
41 | 41 | 'default' => ' |
42 | 42 | # This is a fix for InnoDB in MySQL >= 4.1.x |
43 | 43 | # It "suspends judgement" for fkey relationships until are tables are set. |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | */ |
68 | 68 | public function getDownSQL() |
69 | 69 | { |
70 | - return array ( |
|
70 | + return array( |
|
71 | 71 | 'default' => ' |
72 | 72 | # This is a fix for InnoDB in MySQL >= 4.1.x |
73 | 73 | # It "suspends judgement" for fkey relationships until are tables are set. |
@@ -12,12 +12,12 @@ |
||
12 | 12 | class ServiceProvider extends AbstractServiceProvider |
13 | 13 | { |
14 | 14 | |
15 | - protected $provides = [ |
|
15 | + protected $provides = [ |
|
16 | 16 | |
17 | - ]; |
|
17 | + ]; |
|
18 | 18 | |
19 | - public function register() |
|
20 | - { |
|
19 | + public function register() |
|
20 | + { |
|
21 | 21 | |
22 | - } |
|
22 | + } |
|
23 | 23 | } |
@@ -10,26 +10,26 @@ |
||
10 | 10 | class User implements \Frameworkless\SeedInterface |
11 | 11 | { |
12 | 12 | |
13 | - /** |
|
14 | - * |
|
15 | - * @param type $id |
|
16 | - * @return type |
|
17 | - */ |
|
18 | - static public function build($id = 1) |
|
19 | - { |
|
20 | - $generator = \Faker\Factory::create(); |
|
21 | - $populator = new \Faker\ORM\Propel2\Populator($generator); |
|
22 | - $populator->addEntity(\Core\Models\User\User::class, $id); |
|
23 | - return $populator->execute(); |
|
24 | - } |
|
13 | + /** |
|
14 | + * |
|
15 | + * @param type $id |
|
16 | + * @return type |
|
17 | + */ |
|
18 | + static public function build($id = 1) |
|
19 | + { |
|
20 | + $generator = \Faker\Factory::create(); |
|
21 | + $populator = new \Faker\ORM\Propel2\Populator($generator); |
|
22 | + $populator->addEntity(\Core\Models\User\User::class, $id); |
|
23 | + return $populator->execute(); |
|
24 | + } |
|
25 | 25 | |
26 | - /** |
|
27 | - * |
|
28 | - * @return type |
|
29 | - */ |
|
30 | - public static function reset() |
|
31 | - { |
|
32 | - return \Core\Models\User\UserQuery::create()->deleteAll(); |
|
33 | - } |
|
26 | + /** |
|
27 | + * |
|
28 | + * @return type |
|
29 | + */ |
|
30 | + public static function reset() |
|
31 | + { |
|
32 | + return \Core\Models\User\UserQuery::create()->deleteAll(); |
|
33 | + } |
|
34 | 34 | |
35 | 35 | } |
@@ -21,23 +21,23 @@ |
||
21 | 21 | |
22 | 22 | protected function execute(InputInterface $input, OutputInterface $output) |
23 | 23 | { |
24 | - $finder = \Symfony\Component\Finder\Finder::create(); |
|
24 | + $finder = \Symfony\Component\Finder\Finder::create(); |
|
25 | 25 | |
26 | - $root_path = __DIR__ . "../../../.."; |
|
26 | + $root_path = __DIR__ . "../../../.."; |
|
27 | 27 | |
28 | - $iterator = $finder |
|
29 | - ->files() |
|
30 | - ->in($root_path . "/vendor/*/*/db"); |
|
28 | + $iterator = $finder |
|
29 | + ->files() |
|
30 | + ->in($root_path . "/vendor/*/*/db"); |
|
31 | 31 | |
32 | - foreach ($iterator as $file) { |
|
32 | + foreach ($iterator as $file) { |
|
33 | 33 | |
34 | - if (!copy($file->getRealpath(), $root_path . '/db/' . $file->getRelativePathname())) { |
|
35 | - $output->writeln( sprintf("error copy migration %s...", $file->getRelativePathname()) ); |
|
36 | - } |
|
37 | - else{ |
|
38 | - $output->writeln( sprintf("copy migration %s", $file->getRelativePathname()) ); |
|
39 | - } |
|
40 | - } |
|
34 | + if (!copy($file->getRealpath(), $root_path . '/db/' . $file->getRelativePathname())) { |
|
35 | + $output->writeln( sprintf("error copy migration %s...", $file->getRelativePathname()) ); |
|
36 | + } |
|
37 | + else{ |
|
38 | + $output->writeln( sprintf("copy migration %s", $file->getRelativePathname()) ); |
|
39 | + } |
|
40 | + } |
|
41 | 41 | |
42 | 42 | $output->writeln("completed!"); |
43 | 43 | } |
@@ -32,10 +32,10 @@ |
||
32 | 32 | foreach ($iterator as $file) { |
33 | 33 | |
34 | 34 | if (!copy($file->getRealpath(), $root_path . '/db/' . $file->getRelativePathname())) { |
35 | - $output->writeln( sprintf("error copy migration %s...", $file->getRelativePathname()) ); |
|
35 | + $output->writeln(sprintf("error copy migration %s...", $file->getRelativePathname())); |
|
36 | 36 | } |
37 | - else{ |
|
38 | - $output->writeln( sprintf("copy migration %s", $file->getRelativePathname()) ); |
|
37 | + else { |
|
38 | + $output->writeln(sprintf("copy migration %s", $file->getRelativePathname())); |
|
39 | 39 | } |
40 | 40 | } |
41 | 41 |
@@ -33,8 +33,7 @@ |
||
33 | 33 | |
34 | 34 | if (!copy($file->getRealpath(), $root_path . '/db/' . $file->getRelativePathname())) { |
35 | 35 | $output->writeln( sprintf("error copy migration %s...", $file->getRelativePathname()) ); |
36 | - } |
|
37 | - else{ |
|
36 | + } else{ |
|
38 | 37 | $output->writeln( sprintf("copy migration %s", $file->getRelativePathname()) ); |
39 | 38 | } |
40 | 39 | } |
@@ -9,7 +9,7 @@ |
||
9 | 9 | */ |
10 | 10 | interface SeedInterface |
11 | 11 | { |
12 | - static public function build($id = 1); |
|
12 | + static public function build($id = 1); |
|
13 | 13 | |
14 | - static public function reset(); |
|
14 | + static public function reset(); |
|
15 | 15 | } |
@@ -9,6 +9,9 @@ |
||
9 | 9 | */ |
10 | 10 | class ModuleController extends BaseController { |
11 | 11 | |
12 | + /** |
|
13 | + * @param string $view |
|
14 | + */ |
|
12 | 15 | protected function render($view, array $data = array()) { |
13 | 16 | |
14 | 17 | $ref = new \ReflectionClass($this); |
@@ -9,35 +9,35 @@ |
||
9 | 9 | */ |
10 | 10 | abstract class ModuleController extends BaseController implements \Frameworkless\ModuleInterface{ |
11 | 11 | |
12 | - protected function render($view, array $data = array()) { |
|
12 | + protected function render($view, array $data = array()) { |
|
13 | 13 | |
14 | - $ref = new \ReflectionClass($this); |
|
14 | + $ref = new \ReflectionClass($this); |
|
15 | 15 | |
16 | - $tpl = (new \SplFileInfo($ref->getFileName()))->getPath() . DIRECTORY_SEPARATOR .'tpl'; |
|
16 | + $tpl = (new \SplFileInfo($ref->getFileName()))->getPath() . DIRECTORY_SEPARATOR .'tpl'; |
|
17 | 17 | |
18 | - $twig = new \Twig_Environment(new \Twig_Loader_Filesystem($tpl)); |
|
18 | + $twig = new \Twig_Environment(new \Twig_Loader_Filesystem($tpl)); |
|
19 | 19 | |
20 | - return $twig->render($view . '.twig',$data); |
|
21 | - } |
|
20 | + return $twig->render($view . '.twig',$data); |
|
21 | + } |
|
22 | 22 | |
23 | - abstract public function process(); |
|
23 | + abstract public function process(); |
|
24 | 24 | |
25 | - /** |
|
26 | - * set module params |
|
27 | - * @param array $params |
|
28 | - * @return $this |
|
29 | - * @throws \Exception |
|
30 | - */ |
|
31 | - public function setParams(array $params = array()) |
|
32 | - { |
|
25 | + /** |
|
26 | + * set module params |
|
27 | + * @param array $params |
|
28 | + * @return $this |
|
29 | + * @throws \Exception |
|
30 | + */ |
|
31 | + public function setParams(array $params = array()) |
|
32 | + { |
|
33 | 33 | |
34 | - foreach($params as $param => $value){ |
|
35 | - if((new \ReflectionClass($this))->hasProperty($param)===false) |
|
36 | - throw new \Exception(sprintf("param '%s' not found in module '%s'",$param,self::class)); |
|
34 | + foreach($params as $param => $value){ |
|
35 | + if((new \ReflectionClass($this))->hasProperty($param)===false) |
|
36 | + throw new \Exception(sprintf("param '%s' not found in module '%s'",$param,self::class)); |
|
37 | 37 | |
38 | - $this->{$param} = $value; |
|
39 | - } |
|
40 | - return $this; |
|
41 | - } |
|
38 | + $this->{$param} = $value; |
|
39 | + } |
|
40 | + return $this; |
|
41 | + } |
|
42 | 42 | |
43 | 43 | } |
@@ -7,17 +7,17 @@ discard block |
||
7 | 7 | * |
8 | 8 | * @author d.lanec |
9 | 9 | */ |
10 | -abstract class ModuleController extends BaseController implements \Frameworkless\ModuleInterface{ |
|
10 | +abstract class ModuleController extends BaseController implements \Frameworkless\ModuleInterface { |
|
11 | 11 | |
12 | 12 | protected function render($view, array $data = array()) { |
13 | 13 | |
14 | 14 | $ref = new \ReflectionClass($this); |
15 | 15 | |
16 | - $tpl = (new \SplFileInfo($ref->getFileName()))->getPath() . DIRECTORY_SEPARATOR .'tpl'; |
|
16 | + $tpl = (new \SplFileInfo($ref->getFileName()))->getPath() . DIRECTORY_SEPARATOR . 'tpl'; |
|
17 | 17 | |
18 | 18 | $twig = new \Twig_Environment(new \Twig_Loader_Filesystem($tpl)); |
19 | 19 | |
20 | - return $twig->render($view . '.twig',$data); |
|
20 | + return $twig->render($view . '.twig', $data); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | abstract public function process(); |
@@ -31,9 +31,9 @@ discard block |
||
31 | 31 | public function setParams(array $params = array()) |
32 | 32 | { |
33 | 33 | |
34 | - foreach($params as $param => $value){ |
|
35 | - if((new \ReflectionClass($this))->hasProperty($param)===false) |
|
36 | - throw new \Exception(sprintf("param '%s' not found in module '%s'",$param,self::class)); |
|
34 | + foreach ($params as $param => $value) { |
|
35 | + if ((new \ReflectionClass($this))->hasProperty($param) === false) |
|
36 | + throw new \Exception(sprintf("param '%s' not found in module '%s'", $param, self::class)); |
|
37 | 37 | |
38 | 38 | $this->{$param} = $value; |
39 | 39 | } |
@@ -32,8 +32,9 @@ |
||
32 | 32 | { |
33 | 33 | |
34 | 34 | foreach($params as $param => $value){ |
35 | - if((new \ReflectionClass($this))->hasProperty($param)===false) |
|
36 | - throw new \Exception(sprintf("param '%s' not found in module '%s'",$param,self::class)); |
|
35 | + if((new \ReflectionClass($this))->hasProperty($param)===false) { |
|
36 | + throw new \Exception(sprintf("param '%s' not found in module '%s'",$param,self::class)); |
|
37 | + } |
|
37 | 38 | |
38 | 39 | $this->{$param} = $value; |
39 | 40 | } |
@@ -12,38 +12,38 @@ |
||
12 | 12 | */ |
13 | 13 | abstract class BaseController implements \Psr\Log\LoggerAwareInterface, PageInterface { |
14 | 14 | |
15 | - /** |
|
16 | - * @var Twig_Environment |
|
17 | - */ |
|
18 | - protected $twig; |
|
15 | + /** |
|
16 | + * @var Twig_Environment |
|
17 | + */ |
|
18 | + protected $twig; |
|
19 | 19 | |
20 | - /** |
|
21 | - * |
|
22 | - * @var StandardDebugBar |
|
23 | - */ |
|
24 | - protected $debugbar; |
|
20 | + /** |
|
21 | + * |
|
22 | + * @var StandardDebugBar |
|
23 | + */ |
|
24 | + protected $debugbar; |
|
25 | 25 | |
26 | - use \Psr\Log\LoggerAwareTrait; |
|
26 | + use \Psr\Log\LoggerAwareTrait; |
|
27 | 27 | |
28 | - protected function render($view,array $data = []){ |
|
28 | + protected function render($view,array $data = []){ |
|
29 | 29 | |
30 | - $debugbarRenderer = $this->debugbar->getJavascriptRenderer("/assets/debug_bar"); |
|
30 | + $debugbarRenderer = $this->debugbar->getJavascriptRenderer("/assets/debug_bar"); |
|
31 | 31 | |
32 | - $data["debugbar_Head"] = $debugbarRenderer->renderHead(); |
|
33 | - $data["debugbar_Body"] = $debugbarRenderer->render(); |
|
32 | + $data["debugbar_Head"] = $debugbarRenderer->renderHead(); |
|
33 | + $data["debugbar_Body"] = $debugbarRenderer->render(); |
|
34 | 34 | |
35 | - return new Response($this->twig->render($view,$data)); |
|
36 | - } |
|
35 | + return new Response($this->twig->render($view,$data)); |
|
36 | + } |
|
37 | 37 | |
38 | - public function setTwig(Twig_Environment $twig) { |
|
39 | - $this->twig = $twig; |
|
40 | - return $this; |
|
41 | - } |
|
38 | + public function setTwig(Twig_Environment $twig) { |
|
39 | + $this->twig = $twig; |
|
40 | + return $this; |
|
41 | + } |
|
42 | 42 | |
43 | - public function setDebugbar(StandardDebugBar $debugbar) { |
|
44 | - $this->debugbar = $debugbar; |
|
45 | - return $this; |
|
46 | - } |
|
43 | + public function setDebugbar(StandardDebugBar $debugbar) { |
|
44 | + $this->debugbar = $debugbar; |
|
45 | + return $this; |
|
46 | + } |
|
47 | 47 | |
48 | 48 | |
49 | 49 |
@@ -25,14 +25,14 @@ |
||
25 | 25 | |
26 | 26 | use \Psr\Log\LoggerAwareTrait; |
27 | 27 | |
28 | - protected function render($view,array $data = []){ |
|
28 | + protected function render($view, array $data = []) { |
|
29 | 29 | |
30 | 30 | $debugbarRenderer = $this->debugbar->getJavascriptRenderer("/assets/debug_bar"); |
31 | 31 | |
32 | 32 | $data["debugbar_Head"] = $debugbarRenderer->renderHead(); |
33 | 33 | $data["debugbar_Body"] = $debugbarRenderer->render(); |
34 | 34 | |
35 | - return new Response($this->twig->render($view,$data)); |
|
35 | + return new Response($this->twig->render($view, $data)); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | public function setTwig(Twig_Environment $twig) { |