@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | __DIR__ . '/config/module.config.routes.php', |
26 | 26 | __DIR__ . '/config/module.config.servicemanager.php', |
27 | 27 | ); |
28 | - foreach($configFiles as $configFile) { |
|
28 | + foreach ($configFiles as $configFile) { |
|
29 | 29 | $config = \Zend\Stdlib\ArrayUtils::merge($config, include $configFile); |
30 | 30 | } |
31 | 31 | return $config; |
@@ -43,25 +43,25 @@ discard block |
||
43 | 43 | |
44 | 44 | public function onBootstrap($e) |
45 | 45 | { |
46 | - if($e->getRequest() instanceof \Zend\Console\Request){ |
|
46 | + if ($e->getRequest() instanceof \Zend\Console\Request) { |
|
47 | 47 | return; |
48 | 48 | } |
49 | 49 | |
50 | 50 | $app = $e->getParam('application'); |
51 | 51 | |
52 | - $locator = $app->getServiceManager(); |
|
52 | + $locator = $app->getServiceManager(); |
|
53 | 53 | $this->setServiceManager($locator); |
54 | 54 | |
55 | - $em = $app->getEventManager()->getSharedManager(); |
|
55 | + $em = $app->getEventManager()->getSharedManager(); |
|
56 | 56 | |
57 | - $em->attach('ImageUploader\Service\Uploader', 'fileupload.pre', array('SpeckCatalog\Event\FileUpload', 'preFileUpload')); |
|
57 | + $em->attach('ImageUploader\Service\Uploader', 'fileupload.pre', array('SpeckCatalog\Event\FileUpload', 'preFileUpload')); |
|
58 | 58 | $em->attach('ImageUploader\Service\Uploader', 'fileupload.post', array('SpeckCatalog\Event\FileUpload', 'postFileUpload')); |
59 | 59 | |
60 | - $em->attach('SpeckCatalog\Service\ProductUom', 'insert.post', function ($e) { |
|
60 | + $em->attach('SpeckCatalog\Service\ProductUom', 'insert.post', function($e) { |
|
61 | 61 | $eventClass = new Event\FrontendEnabled; |
62 | 62 | $eventClass->insertProductUom($e); |
63 | 63 | }); |
64 | - $em->attach('SpeckCatalog\Service\ProductUom', 'update.post', function ($e) { |
|
64 | + $em->attach('SpeckCatalog\Service\ProductUom', 'update.post', function($e) { |
|
65 | 65 | $eventClass = new Event\FrontendEnabled; |
66 | 66 | $eventClass->updateProductUom($e); |
67 | 67 | }); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $em->attach('SpeckCatalog\Service\Product', 'insert.post', array('SpeckCatalog\Event\FrontendEnabled', 'insertProduct')); |
70 | 70 | |
71 | 71 | //install event listeners |
72 | - $em->attach('SpeckInstall\Controller\InstallController', 'install.create_tables.post', array($this, 'constraints'),1); |
|
72 | + $em->attach('SpeckInstall\Controller\InstallController', 'install.create_tables.post', array($this, 'constraints'), 1); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | public function constraints($e) |
@@ -79,15 +79,15 @@ discard block |
||
79 | 79 | |
80 | 80 | //check dependencies |
81 | 81 | $tables = $mapper->query("show tables like 'contact_company'"); |
82 | - if(!count($tables)) { |
|
82 | + if (!count($tables)) { |
|
83 | 83 | return array(false, 'SpeckCatalog could not add table constraints - missing table contact_company from SpeckContact'); |
84 | 84 | } |
85 | 85 | $tables = $mapper->query("show tables like 'catalog_product'"); |
86 | - if(!count($tables)) { |
|
86 | + if (!count($tables)) { |
|
87 | 87 | return array(false, 'SpeckCatalog could not add table constraints - missing tables provided by SpeckCatalog'); |
88 | 88 | } |
89 | 89 | |
90 | - $alter = file_get_contents(__DIR__ .'/data/alter.sql'); |
|
90 | + $alter = file_get_contents(__DIR__ . '/data/alter.sql'); |
|
91 | 91 | $mapper->query($alter); |
92 | 92 | |
93 | 93 | } catch (\Exception $e) { |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -return function ($class) { |
|
2 | +return function($class) { |
|
3 | 3 | static $map; |
4 | 4 | if (!$map) { |
5 | 5 | $map = include __DIR__ . '/autoload_classmap.php'; |
@@ -4,37 +4,37 @@ discard block |
||
4 | 4 | 'speckcatalog_image_mapper' => false, |
5 | 5 | ), |
6 | 6 | 'factories' => array( |
7 | - 'speckcatalog_category_service' => function ($sm) { |
|
7 | + 'speckcatalog_category_service' => function($sm) { |
|
8 | 8 | $service = new \SpeckCatalog\Service\Category; |
9 | 9 | $domain = $sm->get('multisite_domain_data'); |
10 | 10 | $service->setSiteId($domain['website_id']); |
11 | 11 | return $service->setSiteId($domain['website_id']); |
12 | 12 | }, |
13 | - 'speckcatalog_product_image_service' => function ($sm) { |
|
13 | + 'speckcatalog_product_image_service' => function($sm) { |
|
14 | 14 | $service = new \SpeckCatalog\Service\Image; |
15 | 15 | $mapper = $sm->get('speckcatalog_image_mapper')->setParentType('product'); |
16 | 16 | return $service->setEntityMapper($mapper); |
17 | 17 | }, |
18 | - 'speckcatalog_option_image_service' => function ($sm) { |
|
18 | + 'speckcatalog_option_image_service' => function($sm) { |
|
19 | 19 | $service = new \SpeckCatalog\Service\Image; |
20 | 20 | $mapper = $sm->get('speckcatalog_image_mapper')->setParentType('option'); |
21 | 21 | return $service->setEntityMapper($mapper); |
22 | 22 | }, |
23 | - 'speckcatalog_module_options' => function ($sm) { |
|
23 | + 'speckcatalog_module_options' => function($sm) { |
|
24 | 24 | $config = $sm->get('Config'); |
25 | 25 | return new \SpeckCatalog\Options\ModuleOptions(isset($config['speckcatalog']) ? $config['speckcatalog'] : array()); |
26 | 26 | }, |
27 | - 'speckcatalog_availability_form' => function ($sm) { |
|
27 | + 'speckcatalog_availability_form' => function($sm) { |
|
28 | 28 | $form = new \SpeckCatalog\Form\Availability; |
29 | 29 | $form->setCompanyService($sm->get('speckcatalog_company_service')); |
30 | 30 | return $form->init(); |
31 | 31 | }, |
32 | - 'speckcatalog_product_form' => function ($sm) { |
|
32 | + 'speckcatalog_product_form' => function($sm) { |
|
33 | 33 | $form = new \SpeckCatalog\Form\Product; |
34 | 34 | $form->setCompanyService($sm->get('speckcatalog_company_service')); |
35 | 35 | return $form->init(); |
36 | 36 | }, |
37 | - 'speckcatalog_product_uom_form' => function ($sm) { |
|
37 | + 'speckcatalog_product_uom_form' => function($sm) { |
|
38 | 38 | $form = new \SpeckCatalog\Form\ProductUom; |
39 | 39 | $form->setUomService($sm->get('speckcatalog_uom_service')); |
40 | 40 | return $form->init(); |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | 'speckcatalog_db' => 'Zend\Db\Adapter\Adapter', |
45 | 45 | ), |
46 | 46 | 'initializers' => array( |
47 | - function($instance, $sm){ |
|
48 | - if($instance instanceof \SpeckCatalog\Mapper\DbAdapterAwareInterface){ |
|
47 | + function($instance, $sm) { |
|
48 | + if ($instance instanceof \SpeckCatalog\Mapper\DbAdapterAwareInterface) { |
|
49 | 49 | $dbAdapter = $sm->get('speckcatalog_db'); |
50 | 50 | $instance->setDbAdapter($dbAdapter); |
51 | 51 | } |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | 'class' => 'SpeckCatalog\View\Helper\CssClass', |
17 | 17 | ), |
18 | 18 | 'factories' => array( |
19 | - 'speckCatalogProduct' => function ($sm) { |
|
19 | + 'speckCatalogProduct' => function($sm) { |
|
20 | 20 | $sm = $sm->getServiceLocator(); |
21 | 21 | $helper = new \SpeckCatalog\View\Helper\Product(); |
22 | 22 | $helper->setProductUomService($sm->get('speckcatalog_product_uom_service')); |
@@ -29,13 +29,13 @@ discard block |
||
29 | 29 | $helper->setPartialDir($options->getCatalogManagerPartialDir()); |
30 | 30 | return $helper; |
31 | 31 | }, |
32 | - 'speckCatalogOptionImageUploader' => function ($sm) { |
|
32 | + 'speckCatalogOptionImageUploader' => function($sm) { |
|
33 | 33 | $imageUploader = $sm->get('imageUploader'); |
34 | 34 | $element = array('name' => 'file_type', 'attributes' => array('value' => 'optionImage', 'type' => 'hidden')); |
35 | 35 | $imageUploader->getForm()->add($element); |
36 | 36 | return $imageUploader; |
37 | 37 | }, |
38 | - 'speckCatalogManagerSideNav' => function ($sm) { |
|
38 | + 'speckCatalogManagerSideNav' => function($sm) { |
|
39 | 39 | $sm = $sm->getServiceLocator(); |
40 | 40 | $app = $sm->get('application'); |
41 | 41 | $routeMatch = $app->getMvcEvent()->getRouteMatch(); |
@@ -43,36 +43,36 @@ discard block |
||
43 | 43 | $helper->setRouteMatch($routeMatch); |
44 | 44 | return $helper; |
45 | 45 | }, |
46 | - 'speckCatalogProductImageUploader' => function ($sm) { |
|
46 | + 'speckCatalogProductImageUploader' => function($sm) { |
|
47 | 47 | $imageUploader = $sm->get('imageUploader'); |
48 | 48 | $element = array('name' => 'file_type', 'attributes' => array('value' => 'productImage', 'type' => 'hidden')); |
49 | 49 | $imageUploader->getForm()->add($element); |
50 | 50 | return $imageUploader; |
51 | 51 | }, |
52 | - 'speckCatalogProductDocumentUploader' => function ($sm) { |
|
52 | + 'speckCatalogProductDocumentUploader' => function($sm) { |
|
53 | 53 | $uploader = $sm->get('imageUploader'); |
54 | 54 | $element = array('name' => 'file_type', 'attributes' => array('value' => 'productDocument', 'type' => 'hidden')); |
55 | 55 | $uploader->getForm()->add($element); |
56 | 56 | return $uploader; |
57 | 57 | }, |
58 | - 'speckCatalogCategoryNav' => function ($sm) { |
|
58 | + 'speckCatalogCategoryNav' => function($sm) { |
|
59 | 59 | $sm = $sm->getServiceLocator(); |
60 | 60 | $helper = new Helper\CategoryNav; |
61 | 61 | return $helper->setCategoryService($sm->get('speckcatalog_category_service')); |
62 | 62 | }, |
63 | - 'speckCatalogImage' => function ($sm) { |
|
63 | + 'speckCatalogImage' => function($sm) { |
|
64 | 64 | $sm = $sm->getServiceLocator(); |
65 | 65 | $settings = $sm->get('speckcatalog_module_options'); |
66 | 66 | return new Helper\MediaUrl($settings, 'image'); |
67 | 67 | }, |
68 | - 'speckCatalogFeaturedProducts' => function ($sm) { |
|
68 | + 'speckCatalogFeaturedProducts' => function($sm) { |
|
69 | 69 | $speckFeaturedProducts = $sm->get('speckFeaturedProducts'); |
70 | 70 | return $speckFeaturedProducts->setTemplate('/speck-catalog/product/feature-clip'); |
71 | 71 | }, |
72 | 72 | ), |
73 | 73 | 'initializers' => array( |
74 | - function($instance, $sm){ |
|
75 | - if($instance instanceof FormServiceAwareInterface){ |
|
74 | + function($instance, $sm) { |
|
75 | + if ($instance instanceof FormServiceAwareInterface) { |
|
76 | 76 | $sm = $sm->getServiceLocator(); |
77 | 77 | $formService = $sm->get('speckcatalog_form_service'); |
78 | 78 | $instance->setFormService($formService); |
@@ -8,7 +8,7 @@ |
||
8 | 8 | { |
9 | 9 | public function getItems($a, $b) |
10 | 10 | { |
11 | - $items=parent::getItems($a, $b); |
|
11 | + $items = parent::getItems($a, $b); |
|
12 | 12 | $return = array(); |
13 | 13 | foreach ($items as $item) { |
14 | 14 | $return[] = $item; |
@@ -77,7 +77,7 @@ |
||
77 | 77 | $offset = ((($page * $perPage) - $perPage) + 1); //this is the first item on the page |
78 | 78 | |
79 | 79 | $paginatorVars['p'] = floor($offset / $_GET['nn']) + 1; //new page number |
80 | - $paginatorVars['n'] = $_GET['nn']; //new items per page |
|
80 | + $paginatorVars['n'] = $_GET['nn']; //new items per page |
|
81 | 81 | |
82 | 82 | $query = '?' . http_build_query($paginatorVars); |
83 | 83 |
@@ -13,7 +13,7 @@ |
||
13 | 13 | * flag is set to false if edit() has been called, |
14 | 14 | * to differentiate between a form for a new record, or an existing record. |
15 | 15 | */ |
16 | - protected $new=true; |
|
16 | + protected $new = true; |
|
17 | 17 | |
18 | 18 | /* |
19 | 19 | * automatically set the hydrator for the form |
@@ -111,7 +111,7 @@ |
||
111 | 111 | 'INNER' |
112 | 112 | ) |
113 | 113 | ->where(array( |
114 | - $c_o . '.builder' => 1, |
|
114 | + $c_o . '.builder' => 1, |
|
115 | 115 | $c_p_o . '.product_id' => $productId, |
116 | 116 | )); |
117 | 117 |
@@ -13,7 +13,7 @@ |
||
13 | 13 | $data['name'] = $model->getName(); |
14 | 14 | $data['instruction'] = $model->getInstruction(); |
15 | 15 | $data['required'] = ($model->getRequired()) ? 1 : 0; |
16 | - $data['builder'] = ($model->getBuilder()) ? 1 : 0; |
|
16 | + $data['builder'] = ($model->getBuilder()) ? 1 : 0; |
|
17 | 17 | $data['option_type_id'] = $model->getOptionTypeId(); |
18 | 18 | |
19 | 19 | return $data; |