@@ -228,11 +228,11 @@ discard block |
||
228 | 228 | * |
229 | 229 | * @param array $siteids List of IDs for sites whose entries should be deleted |
230 | 230 | */ |
231 | - public function cleanup( array $siteids ) |
|
231 | + public function cleanup(array $siteids) |
|
232 | 232 | { |
233 | 233 | $path = 'mshop/customer/manager/submanagers'; |
234 | - foreach( $this->getContext()->getConfig()->get( $path, array( 'address', 'lists' ) ) as $domain ) { |
|
235 | - $this->getSubManager( $domain )->cleanup( $siteids ); |
|
234 | + foreach ($this->getContext()->getConfig()->get($path, array('address', 'lists')) as $domain) { |
|
235 | + $this->getSubManager($domain)->cleanup($siteids); |
|
236 | 236 | } |
237 | 237 | } |
238 | 238 | |
@@ -242,10 +242,10 @@ discard block |
||
242 | 242 | * |
243 | 243 | * @param array $ids List of IDs |
244 | 244 | */ |
245 | - public function deleteItems( array $ids ) |
|
245 | + public function deleteItems(array $ids) |
|
246 | 246 | { |
247 | 247 | $path = 'mshop/customer/manager/ezpublish/delete'; |
248 | - $this->deleteItemsBase( $ids, $path, false, 'contentobject_id' ); |
|
248 | + $this->deleteItemsBase($ids, $path, false, 'contentobject_id'); |
|
249 | 249 | } |
250 | 250 | |
251 | 251 | |
@@ -255,11 +255,11 @@ discard block |
||
255 | 255 | * @param boolean $withsub Return also attributes of sub-managers if true |
256 | 256 | * @return array List of attribute items implementing \Aimeos\MW\Criteria\Attribute\Iface |
257 | 257 | */ |
258 | - public function getSearchAttributes( $withsub = true ) |
|
258 | + public function getSearchAttributes($withsub = true) |
|
259 | 259 | { |
260 | 260 | $path = 'mshop/customer/manager/submanagers'; |
261 | 261 | |
262 | - return $this->getSearchAttributesBase( $this->searchConfig, $path, array( 'address', 'lists' ), $withsub ); |
|
262 | + return $this->getSearchAttributesBase($this->searchConfig, $path, array('address', 'lists'), $withsub); |
|
263 | 263 | } |
264 | 264 | |
265 | 265 | |
@@ -280,37 +280,37 @@ discard block |
||
280 | 280 | * @param \Aimeos\MShop\Customer\Item\Iface $item Customer item object |
281 | 281 | * @param boolean $fetch True if the new ID should be returned in the item |
282 | 282 | */ |
283 | - public function saveItem( \Aimeos\MShop\Common\Item\Iface $item, $fetch = true ) |
|
283 | + public function saveItem(\Aimeos\MShop\Common\Item\Iface $item, $fetch = true) |
|
284 | 284 | { |
285 | 285 | $iface = '\\Aimeos\\MShop\\Customer\\Item\\Iface'; |
286 | - if( !( $item instanceof $iface ) ) { |
|
287 | - throw new \Aimeos\MShop\Customer\Exception( sprintf( 'Object is not of required type "%1$s"', $iface ) ); |
|
286 | + if (!($item instanceof $iface)) { |
|
287 | + throw new \Aimeos\MShop\Customer\Exception(sprintf('Object is not of required type "%1$s"', $iface)); |
|
288 | 288 | } |
289 | 289 | |
290 | - if( !$item->isModified() ) { return; } |
|
290 | + if (!$item->isModified()) { return; } |
|
291 | 291 | |
292 | 292 | $context = $this->getContext(); |
293 | 293 | |
294 | 294 | $class = '\Aimeos\MShop\Context\Item\Ezpublish'; |
295 | - if( !is_a( $context, $class ) ) { |
|
296 | - throw new \Aimeos\MShop\Customer\Exception( sprintf( 'Object is not of required type "%1$s"', $class ) ); |
|
295 | + if (!is_a($context, $class)) { |
|
296 | + throw new \Aimeos\MShop\Customer\Exception(sprintf('Object is not of required type "%1$s"', $class)); |
|
297 | 297 | } |
298 | 298 | |
299 | - if( $item->getId() === null ) |
|
299 | + if ($item->getId() === null) |
|
300 | 300 | { |
301 | 301 | $fcn = $context->getEzUser(); |
302 | - $contentId = $fcn( $item->getCode(), $item->getPaymentAddress()->getEmail(), $item->getPassword() ); |
|
303 | - $item->setId( $contentId ); |
|
302 | + $contentId = $fcn($item->getCode(), $item->getPaymentAddress()->getEmail(), $item->getPassword()); |
|
303 | + $item->setId($contentId); |
|
304 | 304 | } |
305 | 305 | |
306 | 306 | $dbm = $context->getDatabaseManager(); |
307 | 307 | $dbname = $this->getResourceName(); |
308 | - $conn = $dbm->acquire( $dbname ); |
|
308 | + $conn = $dbm->acquire($dbname); |
|
309 | 309 | |
310 | 310 | try |
311 | 311 | { |
312 | - $date = date( 'Y-m-d H:i:s' ); |
|
313 | - $ctime = ( $item->getTimeCreated() ? $item->getTimeCreated() : $date ); |
|
312 | + $date = date('Y-m-d H:i:s'); |
|
313 | + $ctime = ($item->getTimeCreated() ? $item->getTimeCreated() : $date); |
|
314 | 314 | $billingAddress = $item->getPaymentAddress(); |
315 | 315 | |
316 | 316 | /** mshop/customer/manager/ezpublish/update |
@@ -341,44 +341,44 @@ discard block |
||
341 | 341 | */ |
342 | 342 | $path = 'mshop/customer/manager/ezpublish/update'; |
343 | 343 | |
344 | - $stmt = $this->getCachedStatement( $conn, $path ); |
|
345 | - |
|
346 | - $stmt->bind( 1, $item->getCode() ); // login normalized |
|
347 | - $stmt->bind( 2, $item->getCode() ); // login |
|
348 | - $stmt->bind( 3, $billingAddress->getCompany() ); |
|
349 | - $stmt->bind( 4, $billingAddress->getVatID() ); |
|
350 | - $stmt->bind( 5, $billingAddress->getSalutation() ); |
|
351 | - $stmt->bind( 6, $billingAddress->getTitle() ); |
|
352 | - $stmt->bind( 7, $billingAddress->getFirstname() ); |
|
353 | - $stmt->bind( 8, $billingAddress->getLastname() ); |
|
354 | - $stmt->bind( 9, $billingAddress->getAddress1() ); |
|
355 | - $stmt->bind( 10, $billingAddress->getAddress2() ); |
|
356 | - $stmt->bind( 11, $billingAddress->getAddress3() ); |
|
357 | - $stmt->bind( 12, $billingAddress->getPostal() ); |
|
358 | - $stmt->bind( 13, $billingAddress->getCity() ); |
|
359 | - $stmt->bind( 14, $billingAddress->getState() ); |
|
360 | - $stmt->bind( 15, $billingAddress->getCountryId() ); |
|
361 | - $stmt->bind( 16, $billingAddress->getLanguageId() ); |
|
362 | - $stmt->bind( 17, $billingAddress->getTelephone() ); |
|
363 | - $stmt->bind( 18, $billingAddress->getEmail() ); |
|
364 | - $stmt->bind( 19, $billingAddress->getTelefax() ); |
|
365 | - $stmt->bind( 20, $billingAddress->getWebsite() ); |
|
366 | - $stmt->bind( 21, $item->getBirthday() ); |
|
367 | - $stmt->bind( 22, $item->getStatus(), \Aimeos\MW\DB\Statement\Base::PARAM_INT ); |
|
368 | - $stmt->bind( 23, $item->getDateVerified() ); |
|
369 | - $stmt->bind( 24, $item->getPassword() ); |
|
370 | - $stmt->bind( 25, $date ); // Modification time |
|
371 | - $stmt->bind( 26, $context->getEditor() ); |
|
372 | - $stmt->bind( 27, $ctime ); // Creation time |
|
373 | - $stmt->bind( 28, $item->getId(), \Aimeos\MW\DB\Statement\Base::PARAM_INT ); |
|
344 | + $stmt = $this->getCachedStatement($conn, $path); |
|
345 | + |
|
346 | + $stmt->bind(1, $item->getCode()); // login normalized |
|
347 | + $stmt->bind(2, $item->getCode()); // login |
|
348 | + $stmt->bind(3, $billingAddress->getCompany()); |
|
349 | + $stmt->bind(4, $billingAddress->getVatID()); |
|
350 | + $stmt->bind(5, $billingAddress->getSalutation()); |
|
351 | + $stmt->bind(6, $billingAddress->getTitle()); |
|
352 | + $stmt->bind(7, $billingAddress->getFirstname()); |
|
353 | + $stmt->bind(8, $billingAddress->getLastname()); |
|
354 | + $stmt->bind(9, $billingAddress->getAddress1()); |
|
355 | + $stmt->bind(10, $billingAddress->getAddress2()); |
|
356 | + $stmt->bind(11, $billingAddress->getAddress3()); |
|
357 | + $stmt->bind(12, $billingAddress->getPostal()); |
|
358 | + $stmt->bind(13, $billingAddress->getCity()); |
|
359 | + $stmt->bind(14, $billingAddress->getState()); |
|
360 | + $stmt->bind(15, $billingAddress->getCountryId()); |
|
361 | + $stmt->bind(16, $billingAddress->getLanguageId()); |
|
362 | + $stmt->bind(17, $billingAddress->getTelephone()); |
|
363 | + $stmt->bind(18, $billingAddress->getEmail()); |
|
364 | + $stmt->bind(19, $billingAddress->getTelefax()); |
|
365 | + $stmt->bind(20, $billingAddress->getWebsite()); |
|
366 | + $stmt->bind(21, $item->getBirthday()); |
|
367 | + $stmt->bind(22, $item->getStatus(), \Aimeos\MW\DB\Statement\Base::PARAM_INT); |
|
368 | + $stmt->bind(23, $item->getDateVerified()); |
|
369 | + $stmt->bind(24, $item->getPassword()); |
|
370 | + $stmt->bind(25, $date); // Modification time |
|
371 | + $stmt->bind(26, $context->getEditor()); |
|
372 | + $stmt->bind(27, $ctime); // Creation time |
|
373 | + $stmt->bind(28, $item->getId(), \Aimeos\MW\DB\Statement\Base::PARAM_INT); |
|
374 | 374 | |
375 | 375 | $stmt->execute()->finish(); |
376 | 376 | |
377 | - $dbm->release( $conn, $dbname ); |
|
377 | + $dbm->release($conn, $dbname); |
|
378 | 378 | } |
379 | - catch( \Exception $e ) |
|
379 | + catch (\Exception $e) |
|
380 | 380 | { |
381 | - $dbm->release( $conn, $dbname ); |
|
381 | + $dbm->release($conn, $dbname); |
|
382 | 382 | throw $e; |
383 | 383 | } |
384 | 384 | } |
@@ -392,11 +392,11 @@ discard block |
||
392 | 392 | * @return array List of items implementing \Aimeos\MShop\Customer\Item\Iface |
393 | 393 | * @throws \Aimeos\MShop\Customer\Exception If creating items failed |
394 | 394 | */ |
395 | - public function searchItems( \Aimeos\MW\Criteria\Iface $search, array $ref = array(), &$total = null ) |
|
395 | + public function searchItems(\Aimeos\MW\Criteria\Iface $search, array $ref = array(), &$total = null) |
|
396 | 396 | { |
397 | 397 | $dbm = $this->getContext()->getDatabaseManager(); |
398 | 398 | $dbname = $this->getResourceName(); |
399 | - $conn = $dbm->acquire( $dbname ); |
|
399 | + $conn = $dbm->acquire($dbname); |
|
400 | 400 | $map = array(); |
401 | 401 | |
402 | 402 | try |
@@ -404,22 +404,22 @@ discard block |
||
404 | 404 | $level = \Aimeos\MShop\Locale\Manager\Base::SITE_ALL; |
405 | 405 | $cfgPathSearch = 'mshop/customer/manager/ezpublish/search'; |
406 | 406 | $cfgPathCount = 'mshop/customer/manager/ezpublish/count'; |
407 | - $required = array( 'customer' ); |
|
407 | + $required = array('customer'); |
|
408 | 408 | |
409 | - $results = $this->searchItemsBase( $conn, $search, $cfgPathSearch, $cfgPathCount, $required, $total, $level ); |
|
410 | - while( ( $row = $results->fetch() ) !== false ) { |
|
411 | - $map[ $row['customer.id'] ] = $row; |
|
409 | + $results = $this->searchItemsBase($conn, $search, $cfgPathSearch, $cfgPathCount, $required, $total, $level); |
|
410 | + while (($row = $results->fetch()) !== false) { |
|
411 | + $map[$row['customer.id']] = $row; |
|
412 | 412 | } |
413 | 413 | |
414 | - $dbm->release( $conn, $dbname ); |
|
414 | + $dbm->release($conn, $dbname); |
|
415 | 415 | } |
416 | - catch( \Exception $e ) |
|
416 | + catch (\Exception $e) |
|
417 | 417 | { |
418 | - $dbm->release( $conn, $dbname ); |
|
418 | + $dbm->release($conn, $dbname); |
|
419 | 419 | throw $e; |
420 | 420 | } |
421 | 421 | |
422 | - return $this->buildItems( $map, $ref, 'customer' ); |
|
422 | + return $this->buildItems($map, $ref, 'customer'); |
|
423 | 423 | } |
424 | 424 | |
425 | 425 | |
@@ -430,9 +430,9 @@ discard block |
||
430 | 430 | * @param string|null $name Name of the implementation, will be from configuration (or Default) if null |
431 | 431 | * @return mixed Manager for different extensions, e.g stock, tags, locations, etc. |
432 | 432 | */ |
433 | - public function getSubManager( $manager, $name = null ) |
|
433 | + public function getSubManager($manager, $name = null) |
|
434 | 434 | { |
435 | - return $this->getSubManagerBase( 'customer', $manager, ( $name === null ? 'Ezpublish' : $name ) ); |
|
435 | + return $this->getSubManagerBase('customer', $manager, ($name === null ? 'Ezpublish' : $name)); |
|
436 | 436 | } |
437 | 437 | |
438 | 438 | |
@@ -444,15 +444,15 @@ discard block |
||
444 | 444 | * @param array $refItems Items referenced by the customer item via the list items |
445 | 445 | * @return \Aimeos\MShop\Customer\Item\Iface New customer item |
446 | 446 | */ |
447 | - protected function createItemBase( array $values = array(), array $listItems = array(), array $refItems = array() ) |
|
447 | + protected function createItemBase(array $values = array(), array $listItems = array(), array $refItems = array()) |
|
448 | 448 | { |
449 | - if( !isset( $this->addressManager ) ) { |
|
450 | - $this->addressManager = $this->getSubManager( 'address' ); |
|
449 | + if (!isset($this->addressManager)) { |
|
450 | + $this->addressManager = $this->getSubManager('address'); |
|
451 | 451 | } |
452 | 452 | |
453 | 453 | $helper = $this->getPasswordHelper(); |
454 | 454 | $address = $this->addressManager->createItem(); |
455 | 455 | |
456 | - return new \Aimeos\MShop\Customer\Item\Standard( $address, $values, $listItems, $refItems, null, $helper ); |
|
456 | + return new \Aimeos\MShop\Customer\Item\Standard($address, $values, $listItems, $refItems, null, $helper); |
|
457 | 457 | } |
458 | 458 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | 'label' => 'Customer address ID', |
27 | 27 | 'code' => 'customer.address.id', |
28 | 28 | 'internalcode' => 'ezuad."id"', |
29 | - 'internaldeps' => array( 'LEFT JOIN "ezuser_address" AS ezuad ON ( ezu."contentobject_id" = ezuad."parentid" )' ), |
|
29 | + 'internaldeps' => array('LEFT JOIN "ezuser_address" AS ezuad ON ( ezu."contentobject_id" = ezuad."parentid" )'), |
|
30 | 30 | 'type' => 'integer', |
31 | 31 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT, |
32 | 32 | 'public' => false, |
@@ -209,11 +209,11 @@ discard block |
||
209 | 209 | * |
210 | 210 | * @param array $siteids List of IDs for sites whose entries should be deleted |
211 | 211 | */ |
212 | - public function cleanup( array $siteids ) |
|
212 | + public function cleanup(array $siteids) |
|
213 | 213 | { |
214 | 214 | $path = 'mshop/customer/manager/address/submanagers'; |
215 | - foreach( $this->getContext()->getConfig()->get( $path, array() ) as $domain ) { |
|
216 | - $this->getSubManager( $domain )->cleanup( $siteids ); |
|
215 | + foreach ($this->getContext()->getConfig()->get($path, array()) as $domain) { |
|
216 | + $this->getSubManager($domain)->cleanup($siteids); |
|
217 | 217 | } |
218 | 218 | } |
219 | 219 | |
@@ -223,10 +223,10 @@ discard block |
||
223 | 223 | * |
224 | 224 | * @param array $ids List of IDs |
225 | 225 | */ |
226 | - public function deleteItems( array $ids ) |
|
226 | + public function deleteItems(array $ids) |
|
227 | 227 | { |
228 | 228 | $path = 'mshop/customer/manager/address/ezpublish/delete'; |
229 | - $this->deleteItemsBase( $ids, $path, false ); |
|
229 | + $this->deleteItemsBase($ids, $path, false); |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | |
@@ -236,11 +236,11 @@ discard block |
||
236 | 236 | * @param boolean $withsub Return also attributes of sub-managers if true |
237 | 237 | * @return array List of attribute items implementing \Aimeos\MW\Criteria\Attribute\Iface |
238 | 238 | */ |
239 | - public function getSearchAttributes( $withsub = true ) |
|
239 | + public function getSearchAttributes($withsub = true) |
|
240 | 240 | { |
241 | 241 | $path = 'mshop/customer/manager/address/submanagers'; |
242 | 242 | |
243 | - return $this->getSearchAttributesBase( $this->searchConfig, $path, array(), $withsub ); |
|
243 | + return $this->getSearchAttributesBase($this->searchConfig, $path, array(), $withsub); |
|
244 | 244 | } |
245 | 245 | |
246 | 246 | |
@@ -251,9 +251,9 @@ discard block |
||
251 | 251 | * @param string|null $name Name of the implementation, will be from configuration (or Default) if null |
252 | 252 | * @return mixed Manager for different extensions, e.g stock, tags, locations, etc. |
253 | 253 | */ |
254 | - public function getSubManager( $manager, $name = null ) |
|
254 | + public function getSubManager($manager, $name = null) |
|
255 | 255 | { |
256 | - return $this->getSubManagerBase( 'customer', 'address/' . $manager, ( $name === null ? 'Ezpublish' : $name ) ); |
|
256 | + return $this->getSubManagerBase('customer', 'address/'.$manager, ($name === null ? 'Ezpublish' : $name)); |
|
257 | 257 | } |
258 | 258 | |
259 | 259 |
@@ -30,12 +30,12 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public function migrate() |
32 | 32 | { |
33 | - $this->msg( 'Adding address fields to ezuser table', 0 ); |
|
33 | + $this->msg('Adding address fields to ezuser table', 0); |
|
34 | 34 | |
35 | - $dbal = $this->getConnection( 'db-customer' )->getRawObject(); |
|
35 | + $dbal = $this->getConnection('db-customer')->getRawObject(); |
|
36 | 36 | |
37 | - if( !( $dbal instanceof \Doctrine\DBAL\Connection ) ) { |
|
38 | - throw new \Aimeos\MW\Setup\Exception( 'Not a DBAL connection' ); |
|
37 | + if (!($dbal instanceof \Doctrine\DBAL\Connection)) { |
|
38 | + throw new \Aimeos\MW\Setup\Exception('Not a DBAL connection'); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | |
@@ -43,17 +43,17 @@ discard block |
||
43 | 43 | $comparator = new \Doctrine\DBAL\Schema\Comparator(); |
44 | 44 | $toSchema = clone $fromSchema; |
45 | 45 | |
46 | - $this->addIndexes( $this->addColumns( $toSchema->getTable( 'ezuser' ) ) ); |
|
47 | - $sql = $fromSchema->getMigrateToSql( $toSchema, $dbal->getDatabasePlatform() ); |
|
46 | + $this->addIndexes($this->addColumns($toSchema->getTable('ezuser'))); |
|
47 | + $sql = $fromSchema->getMigrateToSql($toSchema, $dbal->getDatabasePlatform()); |
|
48 | 48 | |
49 | - if( $sql !== array() ) |
|
49 | + if ($sql !== array()) |
|
50 | 50 | { |
51 | - $this->executeList( $sql, 'db-customer' ); |
|
52 | - $this->status( 'done' ); |
|
51 | + $this->executeList($sql, 'db-customer'); |
|
52 | + $this->status('done'); |
|
53 | 53 | } |
54 | 54 | else |
55 | 55 | { |
56 | - $this->status( 'OK' ); |
|
56 | + $this->status('OK'); |
|
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
@@ -64,37 +64,37 @@ discard block |
||
64 | 64 | * @param \Doctrine\DBAL\Schema\Table $table Table object |
65 | 65 | * @return \Doctrine\DBAL\Schema\Table Updated table object |
66 | 66 | */ |
67 | - protected function addColumns( \Doctrine\DBAL\Schema\Table $table ) |
|
67 | + protected function addColumns(\Doctrine\DBAL\Schema\Table $table) |
|
68 | 68 | { |
69 | 69 | $columns = array( |
70 | - 'company' => array( 'string', array( 'length' => 100 ) ), |
|
71 | - 'vatid' => array( 'string', array( 'length' => 32 ) ), |
|
72 | - 'salutation' => array( 'string', array( 'length' => 8 ) ), |
|
73 | - 'title' => array( 'string', array( 'length' => 64 ) ), |
|
74 | - 'firstname' => array( 'string', array( 'length' => 64 ) ), |
|
75 | - 'address1' => array( 'string', array( 'length' => 255 ) ), |
|
76 | - 'address2' => array( 'string', array( 'length' => 255 ) ), |
|
77 | - 'address3' => array( 'string', array( 'length' => 255 ) ), |
|
78 | - 'postal' => array( 'string', array( 'length' => 16 ) ), |
|
79 | - 'city' => array( 'string', array( 'length' => 255 ) ), |
|
80 | - 'state' => array( 'string', array( 'length' => 255 ) ), |
|
81 | - 'langid' => array( 'string', array( 'length' => 5, 'notnull' => false ) ), |
|
82 | - 'countryid' => array( 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) ), |
|
83 | - 'telephone' => array( 'string', array( 'length' => 32 ) ), |
|
84 | - 'telefax' => array( 'string', array( 'length' => 32 ) ), |
|
85 | - 'website' => array( 'string', array( 'length' => 255 ) ), |
|
86 | - 'birthday' => array( 'date', array( 'notnull' => false ) ), |
|
87 | - 'vdate' => array( 'date', array( 'notnull' => false ) ), |
|
88 | - 'status' => array( 'smallint', array() ), |
|
89 | - 'mtime' => array( 'datetime', array() ), |
|
90 | - 'ctime' => array( 'datetime', array() ), |
|
91 | - 'editor' => array( 'string', array( 'length' => 255 ) ), |
|
70 | + 'company' => array('string', array('length' => 100)), |
|
71 | + 'vatid' => array('string', array('length' => 32)), |
|
72 | + 'salutation' => array('string', array('length' => 8)), |
|
73 | + 'title' => array('string', array('length' => 64)), |
|
74 | + 'firstname' => array('string', array('length' => 64)), |
|
75 | + 'address1' => array('string', array('length' => 255)), |
|
76 | + 'address2' => array('string', array('length' => 255)), |
|
77 | + 'address3' => array('string', array('length' => 255)), |
|
78 | + 'postal' => array('string', array('length' => 16)), |
|
79 | + 'city' => array('string', array('length' => 255)), |
|
80 | + 'state' => array('string', array('length' => 255)), |
|
81 | + 'langid' => array('string', array('length' => 5, 'notnull' => false)), |
|
82 | + 'countryid' => array('string', array('length' => 2, 'notnull' => false, 'fixed' => true)), |
|
83 | + 'telephone' => array('string', array('length' => 32)), |
|
84 | + 'telefax' => array('string', array('length' => 32)), |
|
85 | + 'website' => array('string', array('length' => 255)), |
|
86 | + 'birthday' => array('date', array('notnull' => false)), |
|
87 | + 'vdate' => array('date', array('notnull' => false)), |
|
88 | + 'status' => array('smallint', array()), |
|
89 | + 'mtime' => array('datetime', array()), |
|
90 | + 'ctime' => array('datetime', array()), |
|
91 | + 'editor' => array('string', array('length' => 255)), |
|
92 | 92 | ); |
93 | 93 | |
94 | - foreach( $columns as $name => $def ) |
|
94 | + foreach ($columns as $name => $def) |
|
95 | 95 | { |
96 | - if( $table->hasColumn( $name ) === false ) { |
|
97 | - $table->addColumn( $name, $def[0], $def[1] ); |
|
96 | + if ($table->hasColumn($name) === false) { |
|
97 | + $table->addColumn($name, $def[0], $def[1]); |
|
98 | 98 | } |
99 | 99 | } |
100 | 100 | |
@@ -108,23 +108,23 @@ discard block |
||
108 | 108 | * @param \Doctrine\DBAL\Schema\Table $table Table object |
109 | 109 | * @return \Doctrine\DBAL\Schema\Table Updated table object |
110 | 110 | */ |
111 | - protected function addIndexes( \Doctrine\DBAL\Schema\Table $table ) |
|
111 | + protected function addIndexes(\Doctrine\DBAL\Schema\Table $table) |
|
112 | 112 | { |
113 | 113 | $indexes = array( |
114 | - 'idx_ezpus_langid' => array( 'langid' ), |
|
115 | - 'idx_ezpus_status_ln_fn' => array( 'status', 'lastname', 'firstname' ), |
|
116 | - 'idx_ezpus_status_ad1_ad2' => array( 'status', 'address1', 'address2' ), |
|
117 | - 'idx_ezpus_status_postal_city' => array( 'status', 'postal', 'city' ), |
|
118 | - 'idx_ezpus_lastname' => array( 'lastname' ), |
|
119 | - 'idx_ezpus_address1' => array( 'address1' ), |
|
120 | - 'idx_ezpus_postal' => array( 'postal' ), |
|
121 | - 'idx_ezpus_city' => array( 'city' ), |
|
114 | + 'idx_ezpus_langid' => array('langid'), |
|
115 | + 'idx_ezpus_status_ln_fn' => array('status', 'lastname', 'firstname'), |
|
116 | + 'idx_ezpus_status_ad1_ad2' => array('status', 'address1', 'address2'), |
|
117 | + 'idx_ezpus_status_postal_city' => array('status', 'postal', 'city'), |
|
118 | + 'idx_ezpus_lastname' => array('lastname'), |
|
119 | + 'idx_ezpus_address1' => array('address1'), |
|
120 | + 'idx_ezpus_postal' => array('postal'), |
|
121 | + 'idx_ezpus_city' => array('city'), |
|
122 | 122 | ); |
123 | 123 | |
124 | - foreach( $indexes as $name => $def ) |
|
124 | + foreach ($indexes as $name => $def) |
|
125 | 125 | { |
126 | - if( $table->hasIndex( $name ) === false ) { |
|
127 | - $table->addIndex( $def, $name ); |
|
126 | + if ($table->hasIndex($name) === false) { |
|
127 | + $table->addIndex($def, $name); |
|
128 | 128 | } |
129 | 129 | } |
130 | 130 |
@@ -8,122 +8,122 @@ |
||
8 | 8 | |
9 | 9 | return array( |
10 | 10 | 'table' => array( |
11 | - 'ezuser' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
11 | + 'ezuser' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
12 | 12 | |
13 | - $table = $schema->createTable( 'ezuser' ); |
|
13 | + $table = $schema->createTable('ezuser'); |
|
14 | 14 | |
15 | - $table->addColumn( 'contentobject_id', 'integer', array() ); |
|
16 | - $table->addColumn( 'email', 'string', array( 'length' => 150 ) ); |
|
17 | - $table->addColumn( 'login', 'string', array( 'length' => 150 ) ); |
|
18 | - $table->addColumn( 'login_normalized', 'string', array( 'length' => 150 ) ); |
|
19 | - $table->addColumn( 'password_hash', 'string', array( 'length' => 50 ) ); |
|
20 | - $table->addColumn( 'password_hash_type', 'integer', array( 'default' => 1 ) ); |
|
15 | + $table->addColumn('contentobject_id', 'integer', array()); |
|
16 | + $table->addColumn('email', 'string', array('length' => 150)); |
|
17 | + $table->addColumn('login', 'string', array('length' => 150)); |
|
18 | + $table->addColumn('login_normalized', 'string', array('length' => 150)); |
|
19 | + $table->addColumn('password_hash', 'string', array('length' => 50)); |
|
20 | + $table->addColumn('password_hash_type', 'integer', array('default' => 1)); |
|
21 | 21 | |
22 | - $table->setPrimaryKey( array( 'contentobject_id' ) ); |
|
23 | - $table->addUniqueIndex( array( 'login_normalized' ), 'ezuser_login' ); |
|
22 | + $table->setPrimaryKey(array('contentobject_id')); |
|
23 | + $table->addUniqueIndex(array('login_normalized'), 'ezuser_login'); |
|
24 | 24 | |
25 | 25 | return $schema; |
26 | 26 | }, |
27 | 27 | |
28 | - 'ezuser_address' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
29 | - |
|
30 | - $table = $schema->createTable( 'ezuser_address' ); |
|
31 | - |
|
32 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
33 | - $table->addColumn( 'siteid', 'integer', array() ); |
|
34 | - $table->addColumn( 'parentid', 'integer', array() ); |
|
35 | - $table->addColumn( 'company', 'string', array( 'length' => 100 ) ); |
|
36 | - $table->addColumn( 'vatid', 'string', array( 'length' => 32 ) ); |
|
37 | - $table->addColumn( 'salutation', 'string', array( 'length' => 8 ) ); |
|
38 | - $table->addColumn( 'title', 'string', array( 'length' => 64 ) ); |
|
39 | - $table->addColumn( 'firstname', 'string', array( 'length' => 64 ) ); |
|
40 | - $table->addColumn( 'lastname', 'string', array( 'length' => 64 ) ); |
|
41 | - $table->addColumn( 'address1', 'string', array( 'length' => 255 ) ); |
|
42 | - $table->addColumn( 'address2', 'string', array( 'length' => 255 ) ); |
|
43 | - $table->addColumn( 'address3', 'string', array( 'length' => 255 ) ); |
|
44 | - $table->addColumn( 'postal', 'string', array( 'length' => 16 ) ); |
|
45 | - $table->addColumn( 'city', 'string', array( 'length' => 255 ) ); |
|
46 | - $table->addColumn( 'state', 'string', array( 'length' => 255 ) ); |
|
47 | - $table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) ); |
|
48 | - $table->addColumn( 'countryid', 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) ); |
|
49 | - $table->addColumn( 'telephone', 'string', array( 'length' => 32 ) ); |
|
50 | - $table->addColumn( 'email', 'string', array( 'length' => 255 ) ); |
|
51 | - $table->addColumn( 'telefax', 'string', array( 'length' => 255 ) ); |
|
52 | - $table->addColumn( 'website', 'string', array( 'length' => 255 ) ); |
|
53 | - $table->addColumn( 'flag', 'integer', array() ); |
|
54 | - $table->addColumn( 'pos', 'smallint', array() ); |
|
55 | - $table->addColumn( 'mtime', 'datetime', array() ); |
|
56 | - $table->addColumn( 'ctime', 'datetime', array() ); |
|
57 | - $table->addColumn( 'editor', 'string', array('length' => 255 ) ); |
|
58 | - |
|
59 | - $table->setPrimaryKey( array( 'id' ), 'pk_ezpad_id' ); |
|
60 | - $table->addIndex( array( 'lastname', 'firstname' ), 'idx_ezpad_ln_fn' ); |
|
61 | - $table->addIndex( array( 'address1', 'address2' ), 'idx_ezpad_ad1_ad2' ); |
|
62 | - $table->addIndex( array( 'postal', 'city' ), 'idx_ezpad_post_ci' ); |
|
63 | - $table->addIndex( array( 'parentid' ), 'idx_ezpad_pid' ); |
|
64 | - $table->addIndex( array( 'city' ), 'idx_ezpad_city' ); |
|
65 | - |
|
66 | - $table->addForeignKeyConstraint( 'ezuser', array( 'parentid' ), array( 'contentobject_id' ), |
|
67 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpad_pid' ); |
|
28 | + 'ezuser_address' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
29 | + |
|
30 | + $table = $schema->createTable('ezuser_address'); |
|
31 | + |
|
32 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
33 | + $table->addColumn('siteid', 'integer', array()); |
|
34 | + $table->addColumn('parentid', 'integer', array()); |
|
35 | + $table->addColumn('company', 'string', array('length' => 100)); |
|
36 | + $table->addColumn('vatid', 'string', array('length' => 32)); |
|
37 | + $table->addColumn('salutation', 'string', array('length' => 8)); |
|
38 | + $table->addColumn('title', 'string', array('length' => 64)); |
|
39 | + $table->addColumn('firstname', 'string', array('length' => 64)); |
|
40 | + $table->addColumn('lastname', 'string', array('length' => 64)); |
|
41 | + $table->addColumn('address1', 'string', array('length' => 255)); |
|
42 | + $table->addColumn('address2', 'string', array('length' => 255)); |
|
43 | + $table->addColumn('address3', 'string', array('length' => 255)); |
|
44 | + $table->addColumn('postal', 'string', array('length' => 16)); |
|
45 | + $table->addColumn('city', 'string', array('length' => 255)); |
|
46 | + $table->addColumn('state', 'string', array('length' => 255)); |
|
47 | + $table->addColumn('langid', 'string', array('length' => 5, 'notnull' => false)); |
|
48 | + $table->addColumn('countryid', 'string', array('length' => 2, 'notnull' => false, 'fixed' => true)); |
|
49 | + $table->addColumn('telephone', 'string', array('length' => 32)); |
|
50 | + $table->addColumn('email', 'string', array('length' => 255)); |
|
51 | + $table->addColumn('telefax', 'string', array('length' => 255)); |
|
52 | + $table->addColumn('website', 'string', array('length' => 255)); |
|
53 | + $table->addColumn('flag', 'integer', array()); |
|
54 | + $table->addColumn('pos', 'smallint', array()); |
|
55 | + $table->addColumn('mtime', 'datetime', array()); |
|
56 | + $table->addColumn('ctime', 'datetime', array()); |
|
57 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
58 | + |
|
59 | + $table->setPrimaryKey(array('id'), 'pk_ezpad_id'); |
|
60 | + $table->addIndex(array('lastname', 'firstname'), 'idx_ezpad_ln_fn'); |
|
61 | + $table->addIndex(array('address1', 'address2'), 'idx_ezpad_ad1_ad2'); |
|
62 | + $table->addIndex(array('postal', 'city'), 'idx_ezpad_post_ci'); |
|
63 | + $table->addIndex(array('parentid'), 'idx_ezpad_pid'); |
|
64 | + $table->addIndex(array('city'), 'idx_ezpad_city'); |
|
65 | + |
|
66 | + $table->addForeignKeyConstraint('ezuser', array('parentid'), array('contentobject_id'), |
|
67 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_ezpad_pid'); |
|
68 | 68 | |
69 | 69 | return $schema; |
70 | 70 | }, |
71 | 71 | |
72 | - 'ezuser_list_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
72 | + 'ezuser_list_type' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
73 | 73 | |
74 | - $table = $schema->createTable( 'ezuser_list_type' ); |
|
74 | + $table = $schema->createTable('ezuser_list_type'); |
|
75 | 75 | |
76 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
77 | - $table->addColumn( 'siteid', 'integer', array() ); |
|
78 | - $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); |
|
79 | - $table->addColumn( 'code', 'string', array( 'length' => 32 ) ); |
|
80 | - $table->addColumn( 'label', 'string', array( 'length' => 255 ) ); |
|
81 | - $table->addColumn( 'status', 'smallint', array() ); |
|
82 | - $table->addColumn( 'mtime', 'datetime', array() ); |
|
83 | - $table->addColumn( 'ctime', 'datetime', array() ); |
|
84 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
76 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
77 | + $table->addColumn('siteid', 'integer', array()); |
|
78 | + $table->addColumn('domain', 'string', array('length' => 32)); |
|
79 | + $table->addColumn('code', 'string', array('length' => 32)); |
|
80 | + $table->addColumn('label', 'string', array('length' => 255)); |
|
81 | + $table->addColumn('status', 'smallint', array()); |
|
82 | + $table->addColumn('mtime', 'datetime', array()); |
|
83 | + $table->addColumn('ctime', 'datetime', array()); |
|
84 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
85 | 85 | |
86 | - $table->setPrimaryKey( array( 'id' ), 'pk_ezplity_id' ); |
|
87 | - $table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_ezplity_sid_dom_code' ); |
|
88 | - $table->addIndex( array( 'siteid', 'status' ), 'idx_ezplity_sid_status' ); |
|
89 | - $table->addIndex( array( 'siteid', 'label' ), 'idx_ezplity_sid_label' ); |
|
90 | - $table->addIndex( array( 'siteid', 'code' ), 'idx_ezplity_sid_code' ); |
|
86 | + $table->setPrimaryKey(array('id'), 'pk_ezplity_id'); |
|
87 | + $table->addUniqueIndex(array('siteid', 'domain', 'code'), 'unq_ezplity_sid_dom_code'); |
|
88 | + $table->addIndex(array('siteid', 'status'), 'idx_ezplity_sid_status'); |
|
89 | + $table->addIndex(array('siteid', 'label'), 'idx_ezplity_sid_label'); |
|
90 | + $table->addIndex(array('siteid', 'code'), 'idx_ezplity_sid_code'); |
|
91 | 91 | |
92 | 92 | return $schema; |
93 | 93 | }, |
94 | 94 | |
95 | - 'ezuser_list' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
96 | - |
|
97 | - $table = $schema->createTable( 'ezuser_list' ); |
|
98 | - |
|
99 | - $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) ); |
|
100 | - $table->addColumn( 'parentid', 'integer', array() ); |
|
101 | - $table->addColumn( 'siteid', 'integer', array() ); |
|
102 | - $table->addColumn( 'typeid', 'integer', array() ); |
|
103 | - $table->addColumn( 'domain', 'string', array( 'length' => 32 ) ); |
|
104 | - $table->addColumn( 'refid', 'string', array( 'length' => 32 ) ); |
|
105 | - $table->addColumn( 'start', 'datetime', array( 'notnull' => false ) ); |
|
106 | - $table->addColumn( 'end', 'datetime', array( 'notnull' => false ) ); |
|
107 | - $table->addColumn( 'config', 'text', array( 'length' => 0xffff ) ); |
|
108 | - $table->addColumn( 'pos', 'integer', array() ); |
|
109 | - $table->addColumn( 'status', 'smallint', array() ); |
|
110 | - $table->addColumn( 'mtime', 'datetime', array() ); |
|
111 | - $table->addColumn( 'ctime', 'datetime', array() ); |
|
112 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
113 | - |
|
114 | - $table->setPrimaryKey( array( 'id' ), 'pk_ezpli_id' ); |
|
115 | - $table->addUniqueIndex( array( 'siteid', 'domain', 'refid', 'typeid', 'parentid' ), 'unq_ezpli_sid_dm_rid_tid_pid' ); |
|
116 | - $table->addIndex( array( 'siteid', 'status', 'start', 'end' ), 'idx_ezpli_sid_stat_start_end' ); |
|
117 | - $table->addIndex( array( 'parentid', 'siteid', 'refid', 'domain', 'typeid' ), 'idx_ezpli_pid_sid_rid_dom_tid' ); |
|
118 | - $table->addIndex( array( 'parentid', 'siteid', 'start' ), 'idx_ezpli_pid_sid_start' ); |
|
119 | - $table->addIndex( array( 'parentid', 'siteid', 'end' ), 'idx_ezpli_pid_sid_end' ); |
|
120 | - $table->addIndex( array( 'parentid', 'siteid', 'pos' ), 'idx_ezpli_pid_sid_pos' ); |
|
121 | - |
|
122 | - $table->addForeignKeyConstraint( 'ezuser', array( 'parentid' ), array( 'contentobject_id' ), |
|
123 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpli_pid' ); |
|
124 | - |
|
125 | - $table->addForeignKeyConstraint( 'ezuser_list_type', array( 'typeid' ), array( 'id' ), |
|
126 | - array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_ezpli_typeid' ); |
|
95 | + 'ezuser_list' => function(\Doctrine\DBAL\Schema\Schema $schema) { |
|
96 | + |
|
97 | + $table = $schema->createTable('ezuser_list'); |
|
98 | + |
|
99 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
100 | + $table->addColumn('parentid', 'integer', array()); |
|
101 | + $table->addColumn('siteid', 'integer', array()); |
|
102 | + $table->addColumn('typeid', 'integer', array()); |
|
103 | + $table->addColumn('domain', 'string', array('length' => 32)); |
|
104 | + $table->addColumn('refid', 'string', array('length' => 32)); |
|
105 | + $table->addColumn('start', 'datetime', array('notnull' => false)); |
|
106 | + $table->addColumn('end', 'datetime', array('notnull' => false)); |
|
107 | + $table->addColumn('config', 'text', array('length' => 0xffff)); |
|
108 | + $table->addColumn('pos', 'integer', array()); |
|
109 | + $table->addColumn('status', 'smallint', array()); |
|
110 | + $table->addColumn('mtime', 'datetime', array()); |
|
111 | + $table->addColumn('ctime', 'datetime', array()); |
|
112 | + $table->addColumn('editor', 'string', array('length' => 255)); |
|
113 | + |
|
114 | + $table->setPrimaryKey(array('id'), 'pk_ezpli_id'); |
|
115 | + $table->addUniqueIndex(array('siteid', 'domain', 'refid', 'typeid', 'parentid'), 'unq_ezpli_sid_dm_rid_tid_pid'); |
|
116 | + $table->addIndex(array('siteid', 'status', 'start', 'end'), 'idx_ezpli_sid_stat_start_end'); |
|
117 | + $table->addIndex(array('parentid', 'siteid', 'refid', 'domain', 'typeid'), 'idx_ezpli_pid_sid_rid_dom_tid'); |
|
118 | + $table->addIndex(array('parentid', 'siteid', 'start'), 'idx_ezpli_pid_sid_start'); |
|
119 | + $table->addIndex(array('parentid', 'siteid', 'end'), 'idx_ezpli_pid_sid_end'); |
|
120 | + $table->addIndex(array('parentid', 'siteid', 'pos'), 'idx_ezpli_pid_sid_pos'); |
|
121 | + |
|
122 | + $table->addForeignKeyConstraint('ezuser', array('parentid'), array('contentobject_id'), |
|
123 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_ezpli_pid'); |
|
124 | + |
|
125 | + $table->addForeignKeyConstraint('ezuser_list_type', array('typeid'), array('id'), |
|
126 | + array('onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'), 'fk_ezpli_typeid'); |
|
127 | 127 | |
128 | 128 | return $schema; |
129 | 129 | }, |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public function getPostDependencies() |
23 | 23 | { |
24 | - return array( 'MShopAddTypeData' ); |
|
24 | + return array('MShopAddTypeData'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | |
@@ -30,15 +30,15 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public function migrate() |
32 | 32 | { |
33 | - $this->msg( 'Creating Aimeos ezPublish tables', 0 ); |
|
34 | - $this->status( '' ); |
|
33 | + $this->msg('Creating Aimeos ezPublish tables', 0); |
|
34 | + $this->status(''); |
|
35 | 35 | |
36 | 36 | $ds = DIRECTORY_SEPARATOR; |
37 | 37 | |
38 | 38 | $files = array( |
39 | - 'db-customer' => __DIR__ . $ds . 'default' . $ds . 'schema' . $ds . 'customer.php', |
|
39 | + 'db-customer' => __DIR__.$ds.'default'.$ds.'schema'.$ds.'customer.php', |
|
40 | 40 | ); |
41 | 41 | |
42 | - $this->setupSchema( $files ); |
|
42 | + $this->setupSchema($files); |
|
43 | 43 | } |
44 | 44 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | */ |
23 | 23 | public function getPreDependencies() |
24 | 24 | { |
25 | - return array( 'TablesCreateEzpublish', 'CustomerAddEzpublishTestData', 'LocaleAddTestData', 'TextAddTestData' ); |
|
25 | + return array('TablesCreateEzpublish', 'CustomerAddEzpublishTestData', 'LocaleAddTestData', 'TextAddTestData'); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | |
@@ -32,29 +32,29 @@ discard block |
||
32 | 32 | public function migrate() |
33 | 33 | { |
34 | 34 | $iface = '\\Aimeos\\MShop\\Context\\Item\\Iface'; |
35 | - if( !( $this->additional instanceof $iface ) ) { |
|
36 | - throw new \Aimeos\MW\Setup\Exception( sprintf( 'Additionally provided object is not of type "%1$s"', $iface ) ); |
|
35 | + if (!($this->additional instanceof $iface)) { |
|
36 | + throw new \Aimeos\MW\Setup\Exception(sprintf('Additionally provided object is not of type "%1$s"', $iface)); |
|
37 | 37 | } |
38 | 38 | |
39 | - $this->msg( 'Adding customer-list ezPublish test data', 0 ); |
|
40 | - $this->additional->setEditor( 'ai-ezpublish:unittest' ); |
|
39 | + $this->msg('Adding customer-list ezPublish test data', 0); |
|
40 | + $this->additional->setEditor('ai-ezpublish:unittest'); |
|
41 | 41 | |
42 | 42 | $ds = DIRECTORY_SEPARATOR; |
43 | - $path = dirname( __FILE__ ) . $ds . 'data' . $ds . 'customer-list.php'; |
|
43 | + $path = dirname(__FILE__).$ds.'data'.$ds.'customer-list.php'; |
|
44 | 44 | |
45 | - if( ( $testdata = include( $path ) ) === false ){ |
|
46 | - throw new \Aimeos\MShop\Exception( sprintf( 'No file "%1$s" found for customer list domain', $path ) ); |
|
45 | + if (($testdata = include($path)) === false) { |
|
46 | + throw new \Aimeos\MShop\Exception(sprintf('No file "%1$s" found for customer list domain', $path)); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | $refKeys = array(); |
50 | - foreach( $testdata['customer/lists'] as $dataset ) { |
|
51 | - $refKeys[ $dataset['domain'] ][] = $dataset['refid']; |
|
50 | + foreach ($testdata['customer/lists'] as $dataset) { |
|
51 | + $refKeys[$dataset['domain']][] = $dataset['refid']; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | $refIds = array(); |
55 | - $refIds['text'] = $this->getTextData( $refKeys['text'] ); |
|
56 | - $this->addCustomerListData( $testdata, $refIds, 'Ezpublish' ); |
|
55 | + $refIds['text'] = $this->getTextData($refKeys['text']); |
|
56 | + $this->addCustomerListData($testdata, $refIds, 'Ezpublish'); |
|
57 | 57 | |
58 | - $this->status( 'done' ); |
|
58 | + $this->status('done'); |
|
59 | 59 | } |
60 | 60 | } |
@@ -5,16 +5,16 @@ |
||
5 | 5 | * @copyright Aimeos (aimeos.org), 2016 |
6 | 6 | */ |
7 | 7 | |
8 | -return array ( |
|
8 | +return array( |
|
9 | 9 | 'customer' => array( |
10 | - 'customer/UTC001' => array( 'code' => 'UTC001', 'label' => 'unitCustomer1', 'salutation' => 'mr', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'title' => 'Dr.', 'firstname' => 'Max', 'lastname' => 'Mustermann', 'address1' => 'Musterstraße', 'address2' => '1a', 'address3' => '', 'postal' => '20001', 'city' => 'Musterstadt', 'state' => 'Hamburg', 'langid' => 'de', 'countryid' => 'DE', 'telephone' => '01234567890', 'email' => '[email protected]', 'telefax' => '01234567890', 'website' => 'unittest.aimeos.org', 'birthday' => '1970-01-01', 'status' => '1', 'password' => 'test' ), |
|
11 | - 'customer/UTC002' => array( 'code' => 'UTC002', 'label' => 'unitCustomer2', 'salutation' => 'mrs', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'title' => 'Prof. Dr.', 'firstname' => 'Erika', 'lastname' => 'Mustermann', 'address1' => 'Heidestraße', 'address2' => '17', 'address3' => '', 'postal' => '45632', 'city' => 'Köln', 'state' => '', 'langid' => 'de', 'countryid' => 'DE', 'telephone' => '09876543210', 'email' => '[email protected]', 'telefax' => '09876543210', 'website' => 'unittest.aimeos.org', 'birthday' => '1970-01-01', 'status' => '0','password' => 'test' ), |
|
12 | - 'customer/UTC003' => array( 'code' => 'UTC003', 'label' => 'unitCustomer3', 'salutation' => 'mr', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'title' => '', 'firstname' => 'Franz-Xaver', 'lastname' => 'Gabler', 'address1' => 'Phantasiestraße', 'address2' => '2', 'address3' => '', 'postal' => '23643', 'city' => 'Berlin', 'state' => 'Berlin', 'langid' => 'de', 'countryid' => 'DE', 'telephone' => '01234509876', 'email' => '[email protected]', 'telefax' => '055544333212', 'website' => 'unittest.aimeos.org', 'birthday' => '1970-01-01', 'status' => '1', 'password' => 'test' ), |
|
10 | + 'customer/UTC001' => array('code' => 'UTC001', 'label' => 'unitCustomer1', 'salutation' => 'mr', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'title' => 'Dr.', 'firstname' => 'Max', 'lastname' => 'Mustermann', 'address1' => 'Musterstraße', 'address2' => '1a', 'address3' => '', 'postal' => '20001', 'city' => 'Musterstadt', 'state' => 'Hamburg', 'langid' => 'de', 'countryid' => 'DE', 'telephone' => '01234567890', 'email' => '[email protected]', 'telefax' => '01234567890', 'website' => 'unittest.aimeos.org', 'birthday' => '1970-01-01', 'status' => '1', 'password' => 'test'), |
|
11 | + 'customer/UTC002' => array('code' => 'UTC002', 'label' => 'unitCustomer2', 'salutation' => 'mrs', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'title' => 'Prof. Dr.', 'firstname' => 'Erika', 'lastname' => 'Mustermann', 'address1' => 'Heidestraße', 'address2' => '17', 'address3' => '', 'postal' => '45632', 'city' => 'Köln', 'state' => '', 'langid' => 'de', 'countryid' => 'DE', 'telephone' => '09876543210', 'email' => '[email protected]', 'telefax' => '09876543210', 'website' => 'unittest.aimeos.org', 'birthday' => '1970-01-01', 'status' => '0', 'password' => 'test'), |
|
12 | + 'customer/UTC003' => array('code' => 'UTC003', 'label' => 'unitCustomer3', 'salutation' => 'mr', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'title' => '', 'firstname' => 'Franz-Xaver', 'lastname' => 'Gabler', 'address1' => 'Phantasiestraße', 'address2' => '2', 'address3' => '', 'postal' => '23643', 'city' => 'Berlin', 'state' => 'Berlin', 'langid' => 'de', 'countryid' => 'DE', 'telephone' => '01234509876', 'email' => '[email protected]', 'telefax' => '055544333212', 'website' => 'unittest.aimeos.org', 'birthday' => '1970-01-01', 'status' => '1', 'password' => 'test'), |
|
13 | 13 | ), |
14 | 14 | 'customer/address' => array( |
15 | - array ( 'parentid' => 'customer/UTC001', 'company' => 'ABC', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr', 'firstname' => 'Our', 'lastname' => 'Unittest', 'address1' => 'Pickhuben', 'address2' => '2-4', 'address3' => '', 'postal' => '20457', 'city' => 'Hamburg', 'state' => 'Hamburg', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332211', 'email' => '[email protected]', 'telefax' => '055544332212', 'website' => 'unittest.aimeos.org', 'flag' => 0, 'pos' => '0' ), |
|
16 | - array ( 'parentid' => 'customer/UTC002', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr.', 'firstname' => 'Good', 'lastname' => 'Unittest', 'address1' => 'Pickhuben', 'address2' => '2-4', 'address3' => '', 'postal' => '20457', 'city' => 'Hamburg', 'state' => 'Hamburg', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332211', 'email' => '[email protected]', 'telefax' => '055544332212', 'website' => 'unittest.aimeos.org', 'flag' => 0, 'pos' => '1' ), |
|
17 | - array ( 'parentid' => 'customer/UTC002', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr.', 'firstname' => 'Good', 'lastname' => 'Unittest', 'address1' => 'Pickhuben', 'address2' => '2-4', 'address3' => '', 'postal' => '11099', 'city' => 'Berlin', 'state' => 'Berlin', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332221', 'email' => '[email protected]', 'telefax' => '055544333212', 'website' => 'unittest.aimeos.org', 'flag' => 0, 'pos' => '1' ), |
|
18 | - array ( 'parentid' => 'customer/UTC003', 'company' => 'unitcompany', 'vatid' => 'DE999999999', 'salutation' => 'company', 'title' => 'unittitle', 'firstname' => 'unitfirstname', 'lastname' => 'unitlastname', 'address1' => 'unitaddress1', 'address2' => 'unitaddress2', 'address3' => 'unitaddress3', 'postal' => 'unitpostal', 'city' => 'unitcity', 'state' => 'unitstate', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '1234567890', 'email' => '[email protected]', 'telefax' => '1234567891', 'website' => 'unittest.aimeos.org', 'flag' => 0, 'pos' => '2' ), |
|
15 | + array('parentid' => 'customer/UTC001', 'company' => 'ABC', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr', 'firstname' => 'Our', 'lastname' => 'Unittest', 'address1' => 'Pickhuben', 'address2' => '2-4', 'address3' => '', 'postal' => '20457', 'city' => 'Hamburg', 'state' => 'Hamburg', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332211', 'email' => '[email protected]', 'telefax' => '055544332212', 'website' => 'unittest.aimeos.org', 'flag' => 0, 'pos' => '0'), |
|
16 | + array('parentid' => 'customer/UTC002', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr.', 'firstname' => 'Good', 'lastname' => 'Unittest', 'address1' => 'Pickhuben', 'address2' => '2-4', 'address3' => '', 'postal' => '20457', 'city' => 'Hamburg', 'state' => 'Hamburg', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332211', 'email' => '[email protected]', 'telefax' => '055544332212', 'website' => 'unittest.aimeos.org', 'flag' => 0, 'pos' => '1'), |
|
17 | + array('parentid' => 'customer/UTC002', 'company' => 'ABC GmbH', 'vatid' => 'DE999999999', 'salutation' => 'mr', 'title' => 'Dr.', 'firstname' => 'Good', 'lastname' => 'Unittest', 'address1' => 'Pickhuben', 'address2' => '2-4', 'address3' => '', 'postal' => '11099', 'city' => 'Berlin', 'state' => 'Berlin', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '055544332221', 'email' => '[email protected]', 'telefax' => '055544333212', 'website' => 'unittest.aimeos.org', 'flag' => 0, 'pos' => '1'), |
|
18 | + array('parentid' => 'customer/UTC003', 'company' => 'unitcompany', 'vatid' => 'DE999999999', 'salutation' => 'company', 'title' => 'unittitle', 'firstname' => 'unitfirstname', 'lastname' => 'unitlastname', 'address1' => 'unitaddress1', 'address2' => 'unitaddress2', 'address3' => 'unitaddress3', 'postal' => 'unitpostal', 'city' => 'unitcity', 'state' => 'unitstate', 'countryid' => 'DE', 'langid' => 'de', 'telephone' => '1234567890', 'email' => '[email protected]', 'telefax' => '1234567891', 'website' => 'unittest.aimeos.org', 'flag' => 0, 'pos' => '2'), |
|
19 | 19 | ), |
20 | 20 | ); |
@@ -5,15 +5,15 @@ |
||
5 | 5 | * @copyright Aimeos (aimeos.org), 2016 |
6 | 6 | */ |
7 | 7 | |
8 | -return array ( |
|
9 | - 'customer/lists/type' => array ( |
|
10 | - 'text/default' => array( 'domain' => 'text', 'code' => 'default', 'label' => 'Standard', 'status' => 1 ), |
|
8 | +return array( |
|
9 | + 'customer/lists/type' => array( |
|
10 | + 'text/default' => array('domain' => 'text', 'code' => 'default', 'label' => 'Standard', 'status' => 1), |
|
11 | 11 | ), |
12 | 12 | |
13 | - 'customer/lists' => array ( |
|
14 | - array( 'parentid' => 'customer/UTC003', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/information', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => array(), 'pos' => 0, 'status' => 1 ), |
|
15 | - array( 'parentid' => 'customer/UTC003', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/notify', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => array(), 'pos' => 1, 'status' => 1 ), |
|
16 | - array( 'parentid' => 'customer/UTC003', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/newsletter', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => array(), 'pos' => 2, 'status' => 1 ), |
|
17 | - array( 'parentid' => 'customer/UTC001', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/information', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => array(), 'pos' => 3, 'status' => 1 ), |
|
13 | + 'customer/lists' => array( |
|
14 | + array('parentid' => 'customer/UTC003', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/information', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => array(), 'pos' => 0, 'status' => 1), |
|
15 | + array('parentid' => 'customer/UTC003', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/notify', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => array(), 'pos' => 1, 'status' => 1), |
|
16 | + array('parentid' => 'customer/UTC003', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/newsletter', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => array(), 'pos' => 2, 'status' => 1), |
|
17 | + array('parentid' => 'customer/UTC001', 'typeid' => 'text/default', 'domain' => 'text', 'refid' => 'text/customer/information', 'start' => '2010-01-01 00:00:00', 'end' => '2100-01-01 00:00:00', 'config' => array(), 'pos' => 3, 'status' => 1), |
|
18 | 18 | ), |
19 | 19 | ); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public function getPreDependencies() |
23 | 23 | { |
24 | - return array( 'TablesCreateEzpublish', 'EzuserAddAddress', 'MShopSetLocale', 'MediaAddTestData' ); |
|
24 | + return array('TablesCreateEzpublish', 'EzuserAddAddress', 'MShopSetLocale', 'MediaAddTestData'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | |
@@ -31,41 +31,41 @@ discard block |
||
31 | 31 | public function migrate() |
32 | 32 | { |
33 | 33 | $iface = '\\Aimeos\\MShop\\Context\\Item\\Iface'; |
34 | - if( !( $this->additional instanceof $iface ) ) { |
|
35 | - throw new \Aimeos\MW\Setup\Exception( sprintf( 'Additionally provided object is not of type "%1$s"', $iface ) ); |
|
34 | + if (!($this->additional instanceof $iface)) { |
|
35 | + throw new \Aimeos\MW\Setup\Exception(sprintf('Additionally provided object is not of type "%1$s"', $iface)); |
|
36 | 36 | } |
37 | 37 | |
38 | - $context = $this->getEzContext( $this->additional ); |
|
38 | + $context = $this->getEzContext($this->additional); |
|
39 | 39 | |
40 | - $this->msg( 'Adding ezPublish customer test data', 0 ); |
|
40 | + $this->msg('Adding ezPublish customer test data', 0); |
|
41 | 41 | |
42 | 42 | $parentIds = array(); |
43 | 43 | $ds = DIRECTORY_SEPARATOR; |
44 | - $context->setEditor( 'ai-ezpublish:unittest' ); |
|
45 | - $path = __DIR__ . $ds . 'data' . $ds . 'customer.php'; |
|
44 | + $context->setEditor('ai-ezpublish:unittest'); |
|
45 | + $path = __DIR__.$ds.'data'.$ds.'customer.php'; |
|
46 | 46 | |
47 | - if( ( $testdata = include( $path ) ) === false ){ |
|
48 | - throw new \Aimeos\MShop\Exception( sprintf( 'No file "%1$s" found for customer domain', $path ) ); |
|
47 | + if (($testdata = include($path)) === false) { |
|
48 | + throw new \Aimeos\MShop\Exception(sprintf('No file "%1$s" found for customer domain', $path)); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
52 | - $customerManager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $context, 'Ezpublish' ); |
|
53 | - $customerAddressManager = $customerManager->getSubManager( 'address', 'Ezpublish' ); |
|
52 | + $customerManager = \Aimeos\MShop\Customer\Manager\Factory::createManager($context, 'Ezpublish'); |
|
53 | + $customerAddressManager = $customerManager->getSubManager('address', 'Ezpublish'); |
|
54 | 54 | |
55 | 55 | $search = $customerManager->createSearch(); |
56 | - $search->setConditions( $search->compare( '==', 'customer.code', array( 'UTC001', 'UTC002', 'UTC003' ) ) ); |
|
57 | - $items = $customerManager->searchItems( $search ); |
|
56 | + $search->setConditions($search->compare('==', 'customer.code', array('UTC001', 'UTC002', 'UTC003'))); |
|
57 | + $items = $customerManager->searchItems($search); |
|
58 | 58 | |
59 | 59 | $this->conn->begin(); |
60 | 60 | |
61 | - $customerManager->deleteItems( array_keys( $items ) ); |
|
62 | - $parentIds = $this->addCustomerData( $testdata, $customerManager, $customerAddressManager->createItem() ); |
|
63 | - $this->addCustomerAddressData( $testdata, $customerAddressManager, $parentIds ); |
|
61 | + $customerManager->deleteItems(array_keys($items)); |
|
62 | + $parentIds = $this->addCustomerData($testdata, $customerManager, $customerAddressManager->createItem()); |
|
63 | + $this->addCustomerAddressData($testdata, $customerAddressManager, $parentIds); |
|
64 | 64 | |
65 | 65 | $this->conn->commit(); |
66 | 66 | |
67 | 67 | |
68 | - $this->status( 'done' ); |
|
68 | + $this->status('done'); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | |
@@ -75,52 +75,52 @@ discard block |
||
75 | 75 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
76 | 76 | * @return \Aimeos\MShop\Context\Item\Ezpublish Ezpublish context object |
77 | 77 | */ |
78 | - protected function getEzContext( \Aimeos\MShop\Context\Item\Iface $context ) |
|
78 | + protected function getEzContext(\Aimeos\MShop\Context\Item\Iface $context) |
|
79 | 79 | { |
80 | 80 | $class = '\Aimeos\MShop\Context\Item\Ezpublish'; |
81 | - if( is_a( $context, $class ) ) { |
|
81 | + if (is_a($context, $class)) { |
|
82 | 82 | return $context; |
83 | 83 | } |
84 | 84 | |
85 | 85 | $ezContext = new \Aimeos\MShop\Context\Item\Ezpublish(); |
86 | - $ezContext->setDatabaseManager( clone $context->getDatabaseManager() ); |
|
87 | - $ezContext->setSession( clone $context->getSession() ); |
|
88 | - $ezContext->setLogger( clone $context->getLogger() ); |
|
89 | - $ezContext->setLocale( clone $context->getLocale() ); |
|
90 | - $ezContext->setConfig( clone $context->getConfig() ); |
|
91 | - $ezContext->setCache( clone $context->getCache() ); |
|
86 | + $ezContext->setDatabaseManager(clone $context->getDatabaseManager()); |
|
87 | + $ezContext->setSession(clone $context->getSession()); |
|
88 | + $ezContext->setLogger(clone $context->getLogger()); |
|
89 | + $ezContext->setLocale(clone $context->getLocale()); |
|
90 | + $ezContext->setConfig(clone $context->getConfig()); |
|
91 | + $ezContext->setCache(clone $context->getCache()); |
|
92 | 92 | |
93 | 93 | $task = $this; |
94 | 94 | |
95 | - $ezContext->setEzUser( function( $code, $email, $password ) use ( $context ) { |
|
95 | + $ezContext->setEzUser(function($code, $email, $password) use ($context) { |
|
96 | 96 | |
97 | - $id = mt_rand( -0x7fffffff,-1 ); |
|
97 | + $id = mt_rand( -0x7fffffff, -1 ); |
|
98 | 98 | $dbm = $context->getDatabaseManager(); |
99 | - $dbconf = $context->getConfig()->get( 'resource/db-customer' ); |
|
100 | - $dbname = ( $dbconf ? 'db-customer' : 'db' ); |
|
101 | - $conn = $dbm->acquire( $dbname ); |
|
99 | + $dbconf = $context->getConfig()->get('resource/db-customer'); |
|
100 | + $dbname = ($dbconf ? 'db-customer' : 'db'); |
|
101 | + $conn = $dbm->acquire($dbname); |
|
102 | 102 | |
103 | 103 | try |
104 | 104 | { |
105 | - $stmt = $conn->create( 'INSERT INTO "ezuser" ( |
|
105 | + $stmt = $conn->create('INSERT INTO "ezuser" ( |
|
106 | 106 | "contentobject_id", "email", "login", "login_normalized", "password_hash", "password_hash_type" |
107 | 107 | ) VALUES ( |
108 | 108 | ?, ?, ?, ?, ?, 5 |
109 | 109 | )' ); |
110 | 110 | |
111 | - $stmt->bind( 1, $id, \Aimeos\MW\DB\Statement\Base::PARAM_INT ); |
|
112 | - $stmt->bind( 2, $email ); |
|
113 | - $stmt->bind( 3, $code ); |
|
114 | - $stmt->bind( 4, $code ); |
|
115 | - $stmt->bind( 5, $password ); |
|
111 | + $stmt->bind(1, $id, \Aimeos\MW\DB\Statement\Base::PARAM_INT); |
|
112 | + $stmt->bind(2, $email); |
|
113 | + $stmt->bind(3, $code); |
|
114 | + $stmt->bind(4, $code); |
|
115 | + $stmt->bind(5, $password); |
|
116 | 116 | |
117 | 117 | $stmt->execute()->finish(); |
118 | 118 | |
119 | - $dbm->release( $conn, $dbname ); |
|
119 | + $dbm->release($conn, $dbname); |
|
120 | 120 | } |
121 | - catch( \Exception $e ) |
|
121 | + catch (\Exception $e) |
|
122 | 122 | { |
123 | - $dbm->release( $conn, $dbname ); |
|
123 | + $dbm->release($conn, $dbname); |
|
124 | 124 | throw $e; |
125 | 125 | } |
126 | 126 |