@@ -4,17 +4,17 @@ |
||
| 4 | 4 | * Set error reporting to maximum |
| 5 | 5 | */ |
| 6 | 6 | error_reporting( -1 ); |
| 7 | -ini_set( 'display_errors', true ); |
|
| 7 | +ini_set('display_errors', true); |
|
| 8 | 8 | |
| 9 | -date_default_timezone_set( 'UTC' ); |
|
| 9 | +date_default_timezone_set('UTC'); |
|
| 10 | 10 | |
| 11 | 11 | /* |
| 12 | 12 | * Set locale settings to reasonable defaults |
| 13 | 13 | */ |
| 14 | -setlocale( LC_ALL, 'en_US.UTF-8' ); |
|
| 15 | -setlocale( LC_CTYPE, 'en_US.UTF-8' ); |
|
| 16 | -setlocale( LC_NUMERIC, 'POSIX' ); |
|
| 17 | -setlocale( LC_TIME, 'POSIX' ); |
|
| 14 | +setlocale(LC_ALL, 'en_US.UTF-8'); |
|
| 15 | +setlocale(LC_CTYPE, 'en_US.UTF-8'); |
|
| 16 | +setlocale(LC_NUMERIC, 'POSIX'); |
|
| 17 | +setlocale(LC_TIME, 'POSIX'); |
|
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | require_once 'TestHelper.php'; |
@@ -39,9 +39,9 @@ |
||
| 39 | 39 | * @param string $value password of the customer item |
| 40 | 40 | * @return \Aimeos\MShop\Customer\Item\Iface Customer item for chaining method calls |
| 41 | 41 | */ |
| 42 | - public function setPassword( $value ) |
|
| 42 | + public function setPassword($value) |
|
| 43 | 43 | { |
| 44 | - if( $value !== '' && $value != $this->getPassword() ) |
|
| 44 | + if ($value !== '' && $value != $this->getPassword()) |
|
| 45 | 45 | { |
| 46 | 46 | $this->password = (string) $value; |
| 47 | 47 | $this->setModified(); |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | * @param \eZ\Publish\API\Repository\UserService $service eZ user service object |
| 29 | 29 | * @return \Aimeos\MShop\Context\Item\Iface Context item for chaining method calls |
| 30 | 30 | */ |
| 31 | - public function setEzUserService( \eZ\Publish\API\Repository\UserService $service ) |
|
| 31 | + public function setEzUserService(\eZ\Publish\API\Repository\UserService $service) |
|
| 32 | 32 | { |
| 33 | 33 | $this->ezUserService = $service; |
| 34 | 34 | return $this; |
@@ -42,8 +42,8 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | public function getEzUserService() |
| 44 | 44 | { |
| 45 | - if( !isset( $this->ezUserService ) ) { |
|
| 46 | - throw new \Aimeos\MShop\Exception( sprintf( 'eZ user service not available' ) ); |
|
| 45 | + if (!isset($this->ezUserService)) { |
|
| 46 | + throw new \Aimeos\MShop\Exception(sprintf('eZ user service not available')); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | return $this->ezUserService; |
@@ -248,7 +248,7 @@ |
||
| 248 | 248 | * |
| 249 | 249 | * @param string $manager Name of the sub manager type in lower case |
| 250 | 250 | * @param string|null $name Name of the implementation, will be from configuration (or Default) if null |
| 251 | - * @return mixed Manager for different extensions, e.g stock, tags, locations, etc. |
|
| 251 | + * @return \Aimeos\MShop\Common\Manager\Iface Manager for different extensions, e.g stock, tags, locations, etc. |
|
| 252 | 252 | */ |
| 253 | 253 | public function getSubManager( $manager, $name = null ) |
| 254 | 254 | { |
@@ -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, [] ) as $domain ) { |
|
| 216 | - $this->getObject()->getSubManager( $domain )->cleanup( $siteids ); |
|
| 215 | + foreach ($this->getContext()->getConfig()->get($path, []) as $domain) { |
|
| 216 | + $this->getObject()->getSubManager($domain)->cleanup($siteids); |
|
| 217 | 217 | } |
| 218 | 218 | } |
| 219 | 219 | |
@@ -223,9 +223,9 @@ 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 | - $this->deleteItemsBase( $ids, $this->getConfigPath() . 'delete', false ); |
|
| 228 | + $this->deleteItemsBase($ids, $this->getConfigPath().'delete', false); |
|
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | |
@@ -235,11 +235,11 @@ discard block |
||
| 235 | 235 | * @param boolean $withsub Return also attributes of sub-managers if true |
| 236 | 236 | * @return array List of attribute items implementing \Aimeos\MW\Criteria\Attribute\Iface |
| 237 | 237 | */ |
| 238 | - public function getSearchAttributes( $withsub = true ) |
|
| 238 | + public function getSearchAttributes($withsub = true) |
|
| 239 | 239 | { |
| 240 | 240 | $path = 'mshop/customer/manager/address/submanagers'; |
| 241 | 241 | |
| 242 | - return $this->getSearchAttributesBase( $this->getSearchConfig(), $path, [], $withsub ); |
|
| 242 | + return $this->getSearchAttributesBase($this->getSearchConfig(), $path, [], $withsub); |
|
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | |
@@ -250,9 +250,9 @@ discard block |
||
| 250 | 250 | * @param string|null $name Name of the implementation, will be from configuration (or Default) if null |
| 251 | 251 | * @return mixed Manager for different extensions, e.g stock, tags, locations, etc. |
| 252 | 252 | */ |
| 253 | - public function getSubManager( $manager, $name = null ) |
|
| 253 | + public function getSubManager($manager, $name = null) |
|
| 254 | 254 | { |
| 255 | - return $this->getSubManagerBase( 'customer', 'address/' . $manager, ( $name === null ? 'Ezpublish' : $name ) ); |
|
| 255 | + return $this->getSubManagerBase('customer', 'address/'.$manager, ($name === null ? 'Ezpublish' : $name)); |
|
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | /** |
| 227 | 227 | * Removes old entries from the storage. |
| 228 | 228 | * |
| 229 | - * @param array $siteids List of IDs for sites whose entries should be deleted |
|
| 229 | + * @param integer[] $siteids List of IDs for sites whose entries should be deleted |
|
| 230 | 230 | */ |
| 231 | 231 | public function cleanup( array $siteids ) |
| 232 | 232 | { |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | /** |
| 252 | 252 | * Removes multiple items specified by ids in the array. |
| 253 | 253 | * |
| 254 | - * @param array $ids List of IDs |
|
| 254 | + * @param integer[] $ids List of IDs |
|
| 255 | 255 | */ |
| 256 | 256 | public function deleteItems( array $ids ) |
| 257 | 257 | { |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | * |
| 283 | 283 | * @param string $manager Name of the sub manager type in lower case |
| 284 | 284 | * @param string|null $name Name of the implementation, will be from configuration (or Default) if null |
| 285 | - * @return mixed Manager for different extensions, e.g stock, tags, locations, etc. |
|
| 285 | + * @return \Aimeos\MShop\Common\Manager\Iface Manager for different extensions, e.g stock, tags, locations, etc. |
|
| 286 | 286 | */ |
| 287 | 287 | public function getSubManager( $manager, $name = null ) |
| 288 | 288 | { |
@@ -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->getObject()->getSubManager( $domain )->cleanup( $siteids ); |
|
| 234 | + foreach ($this->getContext()->getConfig()->get($path, array('address', 'lists')) as $domain) { |
|
| 235 | + $this->getObject()->getSubManager($domain)->cleanup($siteids); |
|
| 236 | 236 | } |
| 237 | 237 | } |
| 238 | 238 | |
@@ -253,12 +253,12 @@ discard block |
||
| 253 | 253 | * |
| 254 | 254 | * @param array $ids List of IDs |
| 255 | 255 | */ |
| 256 | - public function deleteItems( array $ids ) |
|
| 256 | + public function deleteItems(array $ids) |
|
| 257 | 257 | { |
| 258 | 258 | $service = $this->getContext()->getEzUserService(); |
| 259 | 259 | |
| 260 | - foreach( $ids as $id ) { |
|
| 261 | - $service->deleteUser( $service->loadUser( $id ) ); |
|
| 260 | + foreach ($ids as $id) { |
|
| 261 | + $service->deleteUser($service->loadUser($id)); |
|
| 262 | 262 | } |
| 263 | 263 | } |
| 264 | 264 | |
@@ -269,11 +269,11 @@ discard block |
||
| 269 | 269 | * @param boolean $withsub Return also attributes of sub-managers if true |
| 270 | 270 | * @return array List of attribute items implementing \Aimeos\MW\Criteria\Attribute\Iface |
| 271 | 271 | */ |
| 272 | - public function getSearchAttributes( $withsub = true ) |
|
| 272 | + public function getSearchAttributes($withsub = true) |
|
| 273 | 273 | { |
| 274 | 274 | $path = 'mshop/customer/manager/submanagers'; |
| 275 | 275 | |
| 276 | - return $this->getSearchAttributesBase( $this->searchConfig, $path, array( 'address', 'lists' ), $withsub ); |
|
| 276 | + return $this->getSearchAttributesBase($this->searchConfig, $path, array('address', 'lists'), $withsub); |
|
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | |
@@ -284,9 +284,9 @@ discard block |
||
| 284 | 284 | * @param string|null $name Name of the implementation, will be from configuration (or Default) if null |
| 285 | 285 | * @return mixed Manager for different extensions, e.g stock, tags, locations, etc. |
| 286 | 286 | */ |
| 287 | - public function getSubManager( $manager, $name = null ) |
|
| 287 | + public function getSubManager($manager, $name = null) |
|
| 288 | 288 | { |
| 289 | - return $this->getSubManagerBase( 'customer', $manager, ( $name === null ? 'Ezpublish' : $name ) ); |
|
| 289 | + return $this->getSubManagerBase('customer', $manager, ($name === null ? 'Ezpublish' : $name)); |
|
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | |
@@ -296,88 +296,88 @@ discard block |
||
| 296 | 296 | * @param \Aimeos\MShop\Customer\Item\Iface $item Customer item object |
| 297 | 297 | * @param boolean $fetch True if the new ID should be returned in the item |
| 298 | 298 | */ |
| 299 | - public function saveItem( \Aimeos\MShop\Common\Item\Iface $item, $fetch = true ) |
|
| 299 | + public function saveItem(\Aimeos\MShop\Common\Item\Iface $item, $fetch = true) |
|
| 300 | 300 | { |
| 301 | 301 | $iface = '\\Aimeos\\MShop\\Customer\\Item\\Iface'; |
| 302 | - if( !( $item instanceof $iface ) ) { |
|
| 303 | - throw new \Aimeos\MShop\Customer\Exception( sprintf( 'Object is not of required type "%1$s"', $iface ) ); |
|
| 302 | + if (!($item instanceof $iface)) { |
|
| 303 | + throw new \Aimeos\MShop\Customer\Exception(sprintf('Object is not of required type "%1$s"', $iface)); |
|
| 304 | 304 | } |
| 305 | 305 | |
| 306 | - if( !$item->isModified() ) { return; } |
|
| 306 | + if (!$item->isModified()) { return; } |
|
| 307 | 307 | |
| 308 | 308 | $context = $this->getContext(); |
| 309 | 309 | |
| 310 | 310 | $class = '\Aimeos\MShop\Context\Item\Ezpublish'; |
| 311 | - if( !is_a( $context, $class ) ) { |
|
| 312 | - throw new \Aimeos\MShop\Customer\Exception( sprintf( 'Object is not of required type "%1$s"', $class ) ); |
|
| 311 | + if (!is_a($context, $class)) { |
|
| 312 | + throw new \Aimeos\MShop\Customer\Exception(sprintf('Object is not of required type "%1$s"', $class)); |
|
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | $service = $context->getEzUserService(); |
| 316 | 316 | $email = $item->getPaymentAddress()->getEmail(); |
| 317 | 317 | |
| 318 | - if( $item->getId() !== null ) |
|
| 318 | + if ($item->getId() !== null) |
|
| 319 | 319 | { |
| 320 | 320 | $struct = $service->newUserUpdateStruct(); |
| 321 | 321 | $struct->password = $item->getPassword(); |
| 322 | 322 | $struct->enabled = $item->getStatus(); |
| 323 | 323 | $struct->email = $email; |
| 324 | 324 | |
| 325 | - $user = $service->loadUser( $item->getId() ); |
|
| 326 | - $service->updateUser( $user, $struct ); |
|
| 325 | + $user = $service->loadUser($item->getId()); |
|
| 326 | + $service->updateUser($user, $struct); |
|
| 327 | 327 | } |
| 328 | 328 | else |
| 329 | 329 | { |
| 330 | - $struct = $service->newUserCreateStruct( $item->getCode(), $email, $item->getPassword(), 'eng-GB' ); |
|
| 330 | + $struct = $service->newUserCreateStruct($item->getCode(), $email, $item->getPassword(), 'eng-GB'); |
|
| 331 | 331 | $struct->enabled = $item->getStatus(); |
| 332 | 332 | |
| 333 | - $user = $service->createUser( $struct, [] ); |
|
| 334 | - $item->setId( $user->getUserId() ); |
|
| 333 | + $user = $service->createUser($struct, []); |
|
| 334 | + $item->setId($user->getUserId()); |
|
| 335 | 335 | } |
| 336 | 336 | |
| 337 | 337 | $dbm = $context->getDatabaseManager(); |
| 338 | 338 | $dbname = $this->getResourceName(); |
| 339 | - $conn = $dbm->acquire( $dbname ); |
|
| 339 | + $conn = $dbm->acquire($dbname); |
|
| 340 | 340 | |
| 341 | 341 | try |
| 342 | 342 | { |
| 343 | - $date = date( 'Y-m-d H:i:s' ); |
|
| 344 | - $ctime = ( $item->getTimeCreated() ? $item->getTimeCreated() : $date ); |
|
| 343 | + $date = date('Y-m-d H:i:s'); |
|
| 344 | + $ctime = ($item->getTimeCreated() ? $item->getTimeCreated() : $date); |
|
| 345 | 345 | $billingAddress = $item->getPaymentAddress(); |
| 346 | 346 | |
| 347 | 347 | $path = 'mshop/customer/manager/ezpublish/update'; |
| 348 | - $stmt = $this->getCachedStatement( $conn, $path ); |
|
| 349 | - |
|
| 350 | - $stmt->bind( 1, $billingAddress->getCompany() ); |
|
| 351 | - $stmt->bind( 2, $billingAddress->getVatID() ); |
|
| 352 | - $stmt->bind( 3, $billingAddress->getSalutation() ); |
|
| 353 | - $stmt->bind( 4, $billingAddress->getTitle() ); |
|
| 354 | - $stmt->bind( 5, $billingAddress->getFirstname() ); |
|
| 355 | - $stmt->bind( 6, $billingAddress->getLastname() ); |
|
| 356 | - $stmt->bind( 7, $billingAddress->getAddress1() ); |
|
| 357 | - $stmt->bind( 8, $billingAddress->getAddress2() ); |
|
| 358 | - $stmt->bind( 9, $billingAddress->getAddress3() ); |
|
| 359 | - $stmt->bind( 10, $billingAddress->getPostal() ); |
|
| 360 | - $stmt->bind( 11, $billingAddress->getCity() ); |
|
| 361 | - $stmt->bind( 12, $billingAddress->getState() ); |
|
| 362 | - $stmt->bind( 13, $billingAddress->getCountryId() ); |
|
| 363 | - $stmt->bind( 14, $billingAddress->getLanguageId() ); |
|
| 364 | - $stmt->bind( 15, $billingAddress->getTelephone() ); |
|
| 365 | - $stmt->bind( 16, $billingAddress->getTelefax() ); |
|
| 366 | - $stmt->bind( 17, $billingAddress->getWebsite() ); |
|
| 367 | - $stmt->bind( 18, $item->getBirthday() ); |
|
| 368 | - $stmt->bind( 19, $item->getDateVerified() ); |
|
| 369 | - $stmt->bind( 20, $date ); // Modification time |
|
| 370 | - $stmt->bind( 21, $context->getEditor() ); |
|
| 371 | - $stmt->bind( 22, $ctime ); // Creation time |
|
| 372 | - $stmt->bind( 23, $item->getId(), \Aimeos\MW\DB\Statement\Base::PARAM_INT ); |
|
| 348 | + $stmt = $this->getCachedStatement($conn, $path); |
|
| 349 | + |
|
| 350 | + $stmt->bind(1, $billingAddress->getCompany()); |
|
| 351 | + $stmt->bind(2, $billingAddress->getVatID()); |
|
| 352 | + $stmt->bind(3, $billingAddress->getSalutation()); |
|
| 353 | + $stmt->bind(4, $billingAddress->getTitle()); |
|
| 354 | + $stmt->bind(5, $billingAddress->getFirstname()); |
|
| 355 | + $stmt->bind(6, $billingAddress->getLastname()); |
|
| 356 | + $stmt->bind(7, $billingAddress->getAddress1()); |
|
| 357 | + $stmt->bind(8, $billingAddress->getAddress2()); |
|
| 358 | + $stmt->bind(9, $billingAddress->getAddress3()); |
|
| 359 | + $stmt->bind(10, $billingAddress->getPostal()); |
|
| 360 | + $stmt->bind(11, $billingAddress->getCity()); |
|
| 361 | + $stmt->bind(12, $billingAddress->getState()); |
|
| 362 | + $stmt->bind(13, $billingAddress->getCountryId()); |
|
| 363 | + $stmt->bind(14, $billingAddress->getLanguageId()); |
|
| 364 | + $stmt->bind(15, $billingAddress->getTelephone()); |
|
| 365 | + $stmt->bind(16, $billingAddress->getTelefax()); |
|
| 366 | + $stmt->bind(17, $billingAddress->getWebsite()); |
|
| 367 | + $stmt->bind(18, $item->getBirthday()); |
|
| 368 | + $stmt->bind(19, $item->getDateVerified()); |
|
| 369 | + $stmt->bind(20, $date); // Modification time |
|
| 370 | + $stmt->bind(21, $context->getEditor()); |
|
| 371 | + $stmt->bind(22, $ctime); // Creation time |
|
| 372 | + $stmt->bind(23, $item->getId(), \Aimeos\MW\DB\Statement\Base::PARAM_INT); |
|
| 373 | 373 | |
| 374 | 374 | $stmt->execute()->finish(); |
| 375 | 375 | |
| 376 | - $dbm->release( $conn, $dbname ); |
|
| 376 | + $dbm->release($conn, $dbname); |
|
| 377 | 377 | } |
| 378 | - catch( \Exception $e ) |
|
| 378 | + catch (\Exception $e) |
|
| 379 | 379 | { |
| 380 | - $dbm->release( $conn, $dbname ); |
|
| 380 | + $dbm->release($conn, $dbname); |
|
| 381 | 381 | throw $e; |
| 382 | 382 | } |
| 383 | 383 | } |
@@ -391,11 +391,11 @@ discard block |
||
| 391 | 391 | * @return array List of items implementing \Aimeos\MShop\Customer\Item\Iface |
| 392 | 392 | * @throws \Aimeos\MShop\Customer\Exception If creating items failed |
| 393 | 393 | */ |
| 394 | - public function searchItems( \Aimeos\MW\Criteria\Iface $search, array $ref = [], &$total = null ) |
|
| 394 | + public function searchItems(\Aimeos\MW\Criteria\Iface $search, array $ref = [], &$total = null) |
|
| 395 | 395 | { |
| 396 | 396 | $dbm = $this->getContext()->getDatabaseManager(); |
| 397 | 397 | $dbname = $this->getResourceName(); |
| 398 | - $conn = $dbm->acquire( $dbname ); |
|
| 398 | + $conn = $dbm->acquire($dbname); |
|
| 399 | 399 | $map = []; |
| 400 | 400 | |
| 401 | 401 | try |
@@ -403,34 +403,34 @@ discard block |
||
| 403 | 403 | $level = \Aimeos\MShop\Locale\Manager\Base::SITE_ALL; |
| 404 | 404 | $cfgPathSearch = 'mshop/customer/manager/ezpublish/search'; |
| 405 | 405 | $cfgPathCount = 'mshop/customer/manager/ezpublish/count'; |
| 406 | - $required = array( 'customer' ); |
|
| 406 | + $required = array('customer'); |
|
| 407 | 407 | |
| 408 | - $results = $this->searchItemsBase( $conn, $search, $cfgPathSearch, $cfgPathCount, $required, $total, $level ); |
|
| 408 | + $results = $this->searchItemsBase($conn, $search, $cfgPathSearch, $cfgPathCount, $required, $total, $level); |
|
| 409 | 409 | |
| 410 | - while( ( $row = $results->fetch() ) !== false ) |
|
| 410 | + while (($row = $results->fetch()) !== false) |
|
| 411 | 411 | { |
| 412 | - $map[ $row['customer.id'] ] = $row; |
|
| 413 | - $map[ $row['customer.id'] ]['groups'] = []; |
|
| 412 | + $map[$row['customer.id']] = $row; |
|
| 413 | + $map[$row['customer.id']]['groups'] = []; |
|
| 414 | 414 | } |
| 415 | 415 | |
| 416 | 416 | |
| 417 | 417 | $path = 'mshop/customer/manager/ezpublish/groups'; |
| 418 | - $stmt = $conn->create( $this->getGroupSql( array_keys( $map ), $path ) ); |
|
| 418 | + $stmt = $conn->create($this->getGroupSql(array_keys($map), $path)); |
|
| 419 | 419 | $results = $stmt->execute(); |
| 420 | 420 | |
| 421 | - while( ( $row = $results->fetch() ) !== false ) { |
|
| 422 | - $map[ $row['contentobject_id'] ]['groups'][] = $row['role_id']; |
|
| 421 | + while (($row = $results->fetch()) !== false) { |
|
| 422 | + $map[$row['contentobject_id']]['groups'][] = $row['role_id']; |
|
| 423 | 423 | } |
| 424 | 424 | |
| 425 | - $dbm->release( $conn, $dbname ); |
|
| 425 | + $dbm->release($conn, $dbname); |
|
| 426 | 426 | } |
| 427 | - catch( \Exception $e ) |
|
| 427 | + catch (\Exception $e) |
|
| 428 | 428 | { |
| 429 | - $dbm->release( $conn, $dbname ); |
|
| 429 | + $dbm->release($conn, $dbname); |
|
| 430 | 430 | throw $e; |
| 431 | 431 | } |
| 432 | 432 | |
| 433 | - return $this->buildItems( $map, $ref, 'customer' ); |
|
| 433 | + return $this->buildItems($map, $ref, 'customer'); |
|
| 434 | 434 | } |
| 435 | 435 | |
| 436 | 436 | |
@@ -442,15 +442,15 @@ discard block |
||
| 442 | 442 | * @param array $refItems Items referenced by the customer item via the list items |
| 443 | 443 | * @return \Aimeos\MShop\Customer\Item\Iface New customer item |
| 444 | 444 | */ |
| 445 | - protected function createItemBase( array $values = [], array $listItems = [], array $refItems = [] ) |
|
| 445 | + protected function createItemBase(array $values = [], array $listItems = [], array $refItems = []) |
|
| 446 | 446 | { |
| 447 | - if( !isset( $this->addressManager ) ) { |
|
| 448 | - $this->addressManager = $this->getObject()->getSubManager( 'address' ); |
|
| 447 | + if (!isset($this->addressManager)) { |
|
| 448 | + $this->addressManager = $this->getObject()->getSubManager('address'); |
|
| 449 | 449 | } |
| 450 | 450 | |
| 451 | 451 | $address = $this->addressManager->createItem(); |
| 452 | 452 | |
| 453 | - return new \Aimeos\MShop\Customer\Item\Ezpublish( $address, $values, $listItems, $refItems ); |
|
| 453 | + return new \Aimeos\MShop\Customer\Item\Ezpublish($address, $values, $listItems, $refItems); |
|
| 454 | 454 | } |
| 455 | 455 | |
| 456 | 456 | |
@@ -461,18 +461,18 @@ discard block |
||
| 461 | 461 | * @param string $cfgpath Configuration path to the SQL statement |
| 462 | 462 | * @return string SQL statement ready for execution |
| 463 | 463 | */ |
| 464 | - protected function getGroupSql( array $ids, $cfgpath ) |
|
| 464 | + protected function getGroupSql(array $ids, $cfgpath) |
|
| 465 | 465 | { |
| 466 | - if( empty( $ids ) ) { return '1=1'; } |
|
| 466 | + if (empty($ids)) { return '1=1'; } |
|
| 467 | 467 | |
| 468 | 468 | $search = $this->getObject()->createSearch(); |
| 469 | - $search->setConditions( $search->compare( '==', 'id', $ids ) ); |
|
| 469 | + $search->setConditions($search->compare('==', 'id', $ids)); |
|
| 470 | 470 | |
| 471 | - $types = array( 'id' => \Aimeos\MW\DB\Statement\Base::PARAM_INT ); |
|
| 472 | - $translations = array( 'id' => '"contentobject_id"' ); |
|
| 471 | + $types = array('id' => \Aimeos\MW\DB\Statement\Base::PARAM_INT); |
|
| 472 | + $translations = array('id' => '"contentobject_id"'); |
|
| 473 | 473 | |
| 474 | - $cond = $search->getConditionString( $types, $translations ); |
|
| 474 | + $cond = $search->getConditionString($types, $translations); |
|
| 475 | 475 | |
| 476 | - return str_replace( ':cond', $cond, $this->getSqlConfig( $cfgpath ) ); |
|
| 476 | + return str_replace(':cond', $cond, $this->getSqlConfig($cfgpath)); |
|
| 477 | 477 | } |
| 478 | 478 | } |
@@ -248,7 +248,7 @@ |
||
| 248 | 248 | * |
| 249 | 249 | * @param string $manager Name of the sub manager type in lower case |
| 250 | 250 | * @param string|null $name Name of the implementation, will be from configuration (or Default) if null |
| 251 | - * @return mixed Manager for different extensions, e.g stock, tags, locations, etc. |
|
| 251 | + * @return \Aimeos\MShop\Common\Manager\Iface Manager for different extensions, e.g stock, tags, locations, etc. |
|
| 252 | 252 | */ |
| 253 | 253 | public function getSubManager( $manager, $name = null ) |
| 254 | 254 | { |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | 'customer.lists.id'=> array( |
| 26 | 26 | 'code'=>'customer.lists.id', |
| 27 | 27 | 'internalcode'=>'ezuli."id"', |
| 28 | - 'internaldeps' => array( 'LEFT JOIN "ezuser_list" AS ezuli ON ( ezu."id" = ezuli."parentid" )' ), |
|
| 28 | + 'internaldeps' => array('LEFT JOIN "ezuser_list" AS ezuli ON ( ezu."id" = ezuli."parentid" )'), |
|
| 29 | 29 | 'label'=>'Customer list ID', |
| 30 | 30 | 'type'=> 'integer', |
| 31 | 31 | 'internaltype'=> \Aimeos\MW\DB\Statement\Base::PARAM_INT, |
@@ -133,14 +133,14 @@ discard block |
||
| 133 | 133 | * |
| 134 | 134 | * @param array $siteids List of IDs for sites whose entries should be deleted |
| 135 | 135 | */ |
| 136 | - public function cleanup( array $siteids ) |
|
| 136 | + public function cleanup(array $siteids) |
|
| 137 | 137 | { |
| 138 | 138 | $path = 'mshop/customer/manager/lists/submanagers'; |
| 139 | - foreach( $this->getContext()->getConfig()->get( $path, array( 'type' ) ) as $domain ) { |
|
| 140 | - $this->getObject()->getSubManager( $domain )->cleanup( $siteids ); |
|
| 139 | + foreach ($this->getContext()->getConfig()->get($path, array('type')) as $domain) { |
|
| 140 | + $this->getObject()->getSubManager($domain)->cleanup($siteids); |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | - $this->cleanupBase( $siteids, $this->getConfigPath() . 'delete' ); |
|
| 143 | + $this->cleanupBase($siteids, $this->getConfigPath().'delete'); |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | |
@@ -150,11 +150,11 @@ discard block |
||
| 150 | 150 | * @param boolean $withsub Return also attributes of sub-managers if true |
| 151 | 151 | * @return array List of attribute items implementing \Aimeos\MW\Criteria\Attribute\Iface |
| 152 | 152 | */ |
| 153 | - public function getSearchAttributes( $withsub = true ) |
|
| 153 | + public function getSearchAttributes($withsub = true) |
|
| 154 | 154 | { |
| 155 | 155 | $path = 'mshop/customer/manager/lists/submanagers'; |
| 156 | 156 | |
| 157 | - return $this->getSearchAttributesBase( $this->getSearchConfig(), $path, array( 'type' ), $withsub ); |
|
| 157 | + return $this->getSearchAttributesBase($this->getSearchConfig(), $path, array('type'), $withsub); |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | |
@@ -165,9 +165,9 @@ discard block |
||
| 165 | 165 | * @param string|null $name Name of the implementation, will be from configuration (or Default) if null |
| 166 | 166 | * @return mixed Manager for different extensions, e.g stock, tags, locations, etc. |
| 167 | 167 | */ |
| 168 | - public function getSubManager( $manager, $name = null ) |
|
| 168 | + public function getSubManager($manager, $name = null) |
|
| 169 | 169 | { |
| 170 | - return $this->getSubManagerBase( 'customer', 'lists/' . $manager, ( $name === null ? 'Ezpublish' : $name ) ); |
|
| 170 | + return $this->getSubManagerBase('customer', 'lists/'.$manager, ($name === null ? 'Ezpublish' : $name)); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | |
@@ -177,18 +177,18 @@ discard block |
||
| 177 | 177 | * @param \Aimeos\MShop\Common\Item\Lists\Iface $item List item object which should be saved |
| 178 | 178 | * @param boolean $fetch True if the new ID should be returned in the item |
| 179 | 179 | */ |
| 180 | - public function saveItem( \Aimeos\MShop\Common\Item\Iface $item, $fetch = true ) |
|
| 180 | + public function saveItem(\Aimeos\MShop\Common\Item\Iface $item, $fetch = true) |
|
| 181 | 181 | { |
| 182 | 182 | $iface = '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface'; |
| 183 | - if( !( $item instanceof $iface ) ) { |
|
| 184 | - throw new \Aimeos\MShop\Exception( sprintf( 'Object is not of required type "%1$s"', $iface ) ); |
|
| 183 | + if (!($item instanceof $iface)) { |
|
| 184 | + throw new \Aimeos\MShop\Exception(sprintf('Object is not of required type "%1$s"', $iface)); |
|
| 185 | 185 | } |
| 186 | 186 | |
| 187 | - if( $item->getDomain() === 'customer/group' ) { |
|
| 188 | - throw new \Aimeos\MShop\Customer\Exception( sprintf( 'Adding groups to customers is not supported, please use the eZ Publish backend' ) ); |
|
| 187 | + if ($item->getDomain() === 'customer/group') { |
|
| 188 | + throw new \Aimeos\MShop\Customer\Exception(sprintf('Adding groups to customers is not supported, please use the eZ Publish backend')); |
|
| 189 | 189 | } |
| 190 | 190 | |
| 191 | - parent::saveItem( $item, $fetch ); |
|
| 191 | + parent::saveItem($item, $fetch); |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | |
@@ -248,7 +248,7 @@ |
||
| 248 | 248 | * |
| 249 | 249 | * @param string $manager Name of the sub manager type in lower case |
| 250 | 250 | * @param string|null $name Name of the implementation, will be from configuration (or Default) if null |
| 251 | - * @return mixed Manager for different extensions, e.g stock, tags, locations, etc. |
|
| 251 | + * @return \Aimeos\MShop\Common\Manager\Iface Manager for different extensions, e.g stock, tags, locations, etc. |
|
| 252 | 252 | */ |
| 253 | 253 | public function getSubManager( $manager, $name = null ) |
| 254 | 254 | { |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | 'customer.lists.type.id' => array( |
| 26 | 26 | 'code'=>'customer.lists.type.id', |
| 27 | 27 | 'internalcode'=>'ezulity."id"', |
| 28 | - 'internaldeps'=>array( 'LEFT JOIN "ezuser_list_type" AS ezulity ON ( ezuli."typeid" = ezulity."id" )' ), |
|
| 28 | + 'internaldeps'=>array('LEFT JOIN "ezuser_list_type" AS ezulity ON ( ezuli."typeid" = ezulity."id" )'), |
|
| 29 | 29 | 'label'=>'Customer list type ID', |
| 30 | 30 | 'type'=> 'integer', |
| 31 | 31 | 'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_INT, |
@@ -96,14 +96,14 @@ discard block |
||
| 96 | 96 | * |
| 97 | 97 | * @param array $siteids List of IDs for sites whose entries should be deleted |
| 98 | 98 | */ |
| 99 | - public function cleanup( array $siteids ) |
|
| 99 | + public function cleanup(array $siteids) |
|
| 100 | 100 | { |
| 101 | 101 | $path = 'mshop/customer/manager/lists/type/submanagers'; |
| 102 | - foreach( $this->getContext()->getConfig()->get( $path, [] ) as $domain ) { |
|
| 103 | - $this->getObject()->getSubManager( $domain )->cleanup( $siteids ); |
|
| 102 | + foreach ($this->getContext()->getConfig()->get($path, []) as $domain) { |
|
| 103 | + $this->getObject()->getSubManager($domain)->cleanup($siteids); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | - $this->cleanupBase( $siteids, $this->getConfigPath() . 'delete' ); |
|
| 106 | + $this->cleanupBase($siteids, $this->getConfigPath().'delete'); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | |
@@ -113,11 +113,11 @@ discard block |
||
| 113 | 113 | * @param boolean $withsub Return also attributes of sub-managers if true |
| 114 | 114 | * @return array List of attribute items implementing \Aimeos\MW\Criteria\Attribute\Iface |
| 115 | 115 | */ |
| 116 | - public function getSearchAttributes( $withsub = true ) |
|
| 116 | + public function getSearchAttributes($withsub = true) |
|
| 117 | 117 | { |
| 118 | 118 | $path = 'mshop/customer/manager/lists/type/submanagers'; |
| 119 | 119 | |
| 120 | - return $this->getSearchAttributesBase( $this->getSearchConfig(), $path, [], $withsub ); |
|
| 120 | + return $this->getSearchAttributesBase($this->getSearchConfig(), $path, [], $withsub); |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | |
@@ -128,9 +128,9 @@ discard block |
||
| 128 | 128 | * @param string|null $name Name of the implementation, will be from configuration (or Default) if null |
| 129 | 129 | * @return mixed Manager for different extensions, e.g stock, tags, locations, etc. |
| 130 | 130 | */ |
| 131 | - public function getSubManager( $manager, $name = null ) |
|
| 131 | + public function getSubManager($manager, $name = null) |
|
| 132 | 132 | { |
| 133 | - return $this->getSubManagerBase( 'customer', 'lists/type/' . $manager, ( $name === null ? 'Ezpublish' : $name ) ); |
|
| 133 | + return $this->getSubManagerBase('customer', 'lists/type/'.$manager, ($name === null ? 'Ezpublish' : $name)); |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | public function getPreDependencies() |
| 23 | 23 | { |
| 24 | - return array( 'TablesCreateEzpublish' ); |
|
| 24 | + return array('TablesCreateEzpublish'); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | |
@@ -41,29 +41,29 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | public function migrate() |
| 43 | 43 | { |
| 44 | - $this->msg( 'Adding address fields to ezuser table', 0 ); |
|
| 44 | + $this->msg('Adding address fields to ezuser table', 0); |
|
| 45 | 45 | |
| 46 | - $dbal = $this->getConnection( 'db-customer' )->getRawObject(); |
|
| 46 | + $dbal = $this->getConnection('db-customer')->getRawObject(); |
|
| 47 | 47 | |
| 48 | - if( !( $dbal instanceof \Doctrine\DBAL\Connection ) ) { |
|
| 49 | - throw new \Aimeos\MW\Setup\Exception( 'Not a DBAL connection' ); |
|
| 48 | + if (!($dbal instanceof \Doctrine\DBAL\Connection)) { |
|
| 49 | + throw new \Aimeos\MW\Setup\Exception('Not a DBAL connection'); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | |
| 53 | 53 | $fromSchema = $dbal->getSchemaManager()->createSchema(); |
| 54 | 54 | $toSchema = clone $fromSchema; |
| 55 | 55 | |
| 56 | - $this->addIndexes( $this->addColumns( $toSchema->getTable( 'ezuser' ) ) ); |
|
| 57 | - $sql = $fromSchema->getMigrateToSql( $toSchema, $dbal->getDatabasePlatform() ); |
|
| 56 | + $this->addIndexes($this->addColumns($toSchema->getTable('ezuser'))); |
|
| 57 | + $sql = $fromSchema->getMigrateToSql($toSchema, $dbal->getDatabasePlatform()); |
|
| 58 | 58 | |
| 59 | - if( $sql !== [] ) |
|
| 59 | + if ($sql !== []) |
|
| 60 | 60 | { |
| 61 | - $this->executeList( $sql, 'db-customer' ); |
|
| 62 | - $this->status( 'done' ); |
|
| 61 | + $this->executeList($sql, 'db-customer'); |
|
| 62 | + $this->status('done'); |
|
| 63 | 63 | } |
| 64 | 64 | else |
| 65 | 65 | { |
| 66 | - $this->status( 'OK' ); |
|
| 66 | + $this->status('OK'); |
|
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | |
@@ -74,38 +74,38 @@ discard block |
||
| 74 | 74 | * @param \Doctrine\DBAL\Schema\Table $table Table object |
| 75 | 75 | * @return \Doctrine\DBAL\Schema\Table Updated table object |
| 76 | 76 | */ |
| 77 | - protected function addColumns( \Doctrine\DBAL\Schema\Table $table ) |
|
| 77 | + protected function addColumns(\Doctrine\DBAL\Schema\Table $table) |
|
| 78 | 78 | { |
| 79 | 79 | $columns = array( |
| 80 | - 'company' => array( 'string', array( 'length' => 100 ) ), |
|
| 81 | - 'vatid' => array( 'string', array( 'length' => 32 ) ), |
|
| 82 | - 'salutation' => array( 'string', array( 'length' => 8 ) ), |
|
| 83 | - 'title' => array( 'string', array( 'length' => 64 ) ), |
|
| 84 | - 'firstname' => array( 'string', array( 'length' => 64 ) ), |
|
| 85 | - 'lastname' => array( 'string', array( 'length' => 64 ) ), |
|
| 86 | - 'address1' => array( 'string', array( 'length' => 255 ) ), |
|
| 87 | - 'address2' => array( 'string', array( 'length' => 255 ) ), |
|
| 88 | - 'address3' => array( 'string', array( 'length' => 255 ) ), |
|
| 89 | - 'postal' => array( 'string', array( 'length' => 16 ) ), |
|
| 90 | - 'city' => array( 'string', array( 'length' => 255 ) ), |
|
| 91 | - 'state' => array( 'string', array( 'length' => 255 ) ), |
|
| 92 | - 'langid' => array( 'string', array( 'length' => 5, 'notnull' => false ) ), |
|
| 93 | - 'countryid' => array( 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) ), |
|
| 94 | - 'telephone' => array( 'string', array( 'length' => 32 ) ), |
|
| 95 | - 'telefax' => array( 'string', array( 'length' => 32 ) ), |
|
| 96 | - 'website' => array( 'string', array( 'length' => 255 ) ), |
|
| 97 | - 'birthday' => array( 'date', array( 'notnull' => false ) ), |
|
| 98 | - 'vdate' => array( 'date', array( 'notnull' => false ) ), |
|
| 99 | - 'status' => array( 'smallint', [] ), |
|
| 100 | - 'mtime' => array( 'datetime', [] ), |
|
| 101 | - 'ctime' => array( 'datetime', [] ), |
|
| 102 | - 'editor' => array( 'string', array( 'length' => 255 ) ), |
|
| 80 | + 'company' => array('string', array('length' => 100)), |
|
| 81 | + 'vatid' => array('string', array('length' => 32)), |
|
| 82 | + 'salutation' => array('string', array('length' => 8)), |
|
| 83 | + 'title' => array('string', array('length' => 64)), |
|
| 84 | + 'firstname' => array('string', array('length' => 64)), |
|
| 85 | + 'lastname' => array('string', array('length' => 64)), |
|
| 86 | + 'address1' => array('string', array('length' => 255)), |
|
| 87 | + 'address2' => array('string', array('length' => 255)), |
|
| 88 | + 'address3' => array('string', array('length' => 255)), |
|
| 89 | + 'postal' => array('string', array('length' => 16)), |
|
| 90 | + 'city' => array('string', array('length' => 255)), |
|
| 91 | + 'state' => array('string', array('length' => 255)), |
|
| 92 | + 'langid' => array('string', array('length' => 5, 'notnull' => false)), |
|
| 93 | + 'countryid' => array('string', array('length' => 2, 'notnull' => false, 'fixed' => true)), |
|
| 94 | + 'telephone' => array('string', array('length' => 32)), |
|
| 95 | + 'telefax' => array('string', array('length' => 32)), |
|
| 96 | + 'website' => array('string', array('length' => 255)), |
|
| 97 | + 'birthday' => array('date', array('notnull' => false)), |
|
| 98 | + 'vdate' => array('date', array('notnull' => false)), |
|
| 99 | + 'status' => array('smallint', []), |
|
| 100 | + 'mtime' => array('datetime', []), |
|
| 101 | + 'ctime' => array('datetime', []), |
|
| 102 | + 'editor' => array('string', array('length' => 255)), |
|
| 103 | 103 | ); |
| 104 | 104 | |
| 105 | - foreach( $columns as $name => $def ) |
|
| 105 | + foreach ($columns as $name => $def) |
|
| 106 | 106 | { |
| 107 | - if( $table->hasColumn( $name ) === false ) { |
|
| 108 | - $table->addColumn( $name, $def[0], $def[1] ); |
|
| 107 | + if ($table->hasColumn($name) === false) { |
|
| 108 | + $table->addColumn($name, $def[0], $def[1]); |
|
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | |
@@ -119,23 +119,23 @@ discard block |
||
| 119 | 119 | * @param \Doctrine\DBAL\Schema\Table $table Table object |
| 120 | 120 | * @return \Doctrine\DBAL\Schema\Table Updated table object |
| 121 | 121 | */ |
| 122 | - protected function addIndexes( \Doctrine\DBAL\Schema\Table $table ) |
|
| 122 | + protected function addIndexes(\Doctrine\DBAL\Schema\Table $table) |
|
| 123 | 123 | { |
| 124 | 124 | $indexes = array( |
| 125 | - 'idx_ezpus_langid' => array( 'langid' ), |
|
| 126 | - 'idx_ezpus_status_ln_fn' => array( 'status', 'lastname', 'firstname' ), |
|
| 127 | - 'idx_ezpus_status_ad1_ad2' => array( 'status', 'address1', 'address2' ), |
|
| 128 | - 'idx_ezpus_status_postal_city' => array( 'status', 'postal', 'city' ), |
|
| 129 | - 'idx_ezpus_lastname' => array( 'lastname' ), |
|
| 130 | - 'idx_ezpus_address1' => array( 'address1' ), |
|
| 131 | - 'idx_ezpus_postal' => array( 'postal' ), |
|
| 132 | - 'idx_ezpus_city' => array( 'city' ), |
|
| 125 | + 'idx_ezpus_langid' => array('langid'), |
|
| 126 | + 'idx_ezpus_status_ln_fn' => array('status', 'lastname', 'firstname'), |
|
| 127 | + 'idx_ezpus_status_ad1_ad2' => array('status', 'address1', 'address2'), |
|
| 128 | + 'idx_ezpus_status_postal_city' => array('status', 'postal', 'city'), |
|
| 129 | + 'idx_ezpus_lastname' => array('lastname'), |
|
| 130 | + 'idx_ezpus_address1' => array('address1'), |
|
| 131 | + 'idx_ezpus_postal' => array('postal'), |
|
| 132 | + 'idx_ezpus_city' => array('city'), |
|
| 133 | 133 | ); |
| 134 | 134 | |
| 135 | - foreach( $indexes as $name => $def ) |
|
| 135 | + foreach ($indexes as $name => $def) |
|
| 136 | 136 | { |
| 137 | - if( $table->hasIndex( $name ) === false ) { |
|
| 138 | - $table->addIndex( $def, $name ); |
|
| 137 | + if ($table->hasIndex($name) === false) { |
|
| 138 | + $table->addIndex($def, $name); |
|
| 139 | 139 | } |
| 140 | 140 | } |
| 141 | 141 | |
@@ -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', [] ); |
|
| 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', []); |
|
| 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', [] ); |
|
| 34 | - $table->addColumn( 'parentid', 'integer', [] ); |
|
| 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', [] ); |
|
| 54 | - $table->addColumn( 'pos', 'smallint', [] ); |
|
| 55 | - $table->addColumn( 'mtime', 'datetime', [] ); |
|
| 56 | - $table->addColumn( 'ctime', 'datetime', [] ); |
|
| 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', []); |
|
| 34 | + $table->addColumn('parentid', 'integer', []); |
|
| 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', []); |
|
| 54 | + $table->addColumn('pos', 'smallint', []); |
|
| 55 | + $table->addColumn('mtime', 'datetime', []); |
|
| 56 | + $table->addColumn('ctime', 'datetime', []); |
|
| 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', [] ); |
|
| 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', [] ); |
|
| 82 | - $table->addColumn( 'mtime', 'datetime', [] ); |
|
| 83 | - $table->addColumn( 'ctime', 'datetime', [] ); |
|
| 84 | - $table->addColumn( 'editor', 'string', array( 'length' => 255 ) ); |
|
| 76 | + $table->addColumn('id', 'integer', array('autoincrement' => true)); |
|
| 77 | + $table->addColumn('siteid', 'integer', []); |
|
| 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', []); |
|
| 82 | + $table->addColumn('mtime', 'datetime', []); |
|
| 83 | + $table->addColumn('ctime', 'datetime', []); |
|
| 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', [] ); |
|
| 101 | - $table->addColumn( 'siteid', 'integer', [] ); |
|
| 102 | - $table->addColumn( 'typeid', 'integer', [] ); |
|
| 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', [] ); |
|
| 109 | - $table->addColumn( 'status', 'smallint', [] ); |
|
| 110 | - $table->addColumn( 'mtime', 'datetime', [] ); |
|
| 111 | - $table->addColumn( 'ctime', 'datetime', [] ); |
|
| 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', []); |
|
| 101 | + $table->addColumn('siteid', 'integer', []); |
|
| 102 | + $table->addColumn('typeid', 'integer', []); |
|
| 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', []); |
|
| 109 | + $table->addColumn('status', 'smallint', []); |
|
| 110 | + $table->addColumn('mtime', 'datetime', []); |
|
| 111 | + $table->addColumn('ctime', 'datetime', []); |
|
| 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 | }, |