| Total Complexity | 50 |
| Total Lines | 723 |
| Duplicated Lines | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
Complex classes like CustomerAddressBunchProcessor often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use CustomerAddressBunchProcessor, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 35 | class CustomerAddressBunchProcessor implements CustomerAddressBunchProcessorInterface |
||
| 36 | { |
||
| 37 | |||
| 38 | /** |
||
| 39 | * A PDO connection initialized with the values from the Doctrine EntityManager. |
||
| 40 | * |
||
| 41 | * @var \TechDivision\Import\Dbal\Connection\ConnectionInterface |
||
| 42 | */ |
||
| 43 | protected $connection; |
||
| 44 | |||
| 45 | /** |
||
| 46 | * The repository to access EAV attribute option values. |
||
| 47 | * |
||
| 48 | * @var \TechDivision\Import\Repositories\EavAttributeOptionValueRepositoryInterface |
||
| 49 | */ |
||
| 50 | protected $eavAttributeOptionValueRepository; |
||
| 51 | |||
| 52 | /** |
||
| 53 | * The repository to access customer data. |
||
| 54 | * |
||
| 55 | * @var \TechDivision\Import\Customer\Repositories\CustomerRepositoryInterface |
||
| 56 | */ |
||
| 57 | protected $customerRepository; |
||
| 58 | |||
| 59 | /** |
||
| 60 | * The repository to access customer address address data. |
||
| 61 | * |
||
| 62 | * @var \TechDivision\Import\Customer\Address\Repositories\CustomerAddressRepositoryInterface |
||
| 63 | */ |
||
| 64 | protected $customerAddressRepository; |
||
| 65 | |||
| 66 | /** |
||
| 67 | * The repository to access EAV attributes. |
||
| 68 | * |
||
| 69 | * @var \TechDivision\Import\Repositories\EavAttributeRepositoryInterface |
||
| 70 | */ |
||
| 71 | protected $eavAttributeRepository; |
||
| 72 | |||
| 73 | /** |
||
| 74 | * The repository to access EAV attributes. |
||
| 75 | * |
||
| 76 | * @var \TechDivision\Import\Repositories\EavEntityTypeRepositoryInterface |
||
| 77 | */ |
||
| 78 | protected $eavEntityTypeRepository; |
||
| 79 | |||
| 80 | /** |
||
| 81 | * The action for customer address CRUD methods. |
||
| 82 | * |
||
| 83 | * @var \TechDivision\Import\Dbal\Actions\ActionInterface |
||
| 84 | */ |
||
| 85 | protected $customerAddressAction; |
||
| 86 | |||
| 87 | /** |
||
| 88 | * The action for customer address varchar attribute CRUD methods. |
||
| 89 | * |
||
| 90 | * @var \TechDivision\Import\Dbal\Actions\ActionInterface |
||
| 91 | */ |
||
| 92 | protected $customerAddressVarcharAction; |
||
| 93 | |||
| 94 | /** |
||
| 95 | * The action for customer address text attribute CRUD methods. |
||
| 96 | * |
||
| 97 | * @var \TechDivision\Import\Dbal\Actions\ActionInterface |
||
| 98 | */ |
||
| 99 | protected $customerAddressTextAction; |
||
| 100 | |||
| 101 | /** |
||
| 102 | * The action for customer address int attribute CRUD methods. |
||
| 103 | * |
||
| 104 | * @var \TechDivision\Import\Dbal\Actions\ActionInterface |
||
| 105 | */ |
||
| 106 | protected $customerAddressIntAction; |
||
| 107 | |||
| 108 | /** |
||
| 109 | * The action for customer address decimal attribute CRUD methods. |
||
| 110 | * |
||
| 111 | * @var \\TechDivision\Import\Dbal\Actions\ActionInterface |
||
|
|
|||
| 112 | */ |
||
| 113 | protected $customerAddressDecimalAction; |
||
| 114 | |||
| 115 | /** |
||
| 116 | * The action for customer address datetime attribute CRUD methods. |
||
| 117 | * |
||
| 118 | * @var \TechDivision\Import\Dbal\Actions\ActionInterface |
||
| 119 | */ |
||
| 120 | protected $customerAddressDatetimeAction; |
||
| 121 | |||
| 122 | /** |
||
| 123 | * The assembler to load the customer address attributes with. |
||
| 124 | * |
||
| 125 | * @var \TechDivision\Import\Customer\Address\Assemblers\CustomerAddressAttributeAssemblerInterface |
||
| 126 | */ |
||
| 127 | protected $customerAddressAttributeAssembler; |
||
| 128 | |||
| 129 | /** |
||
| 130 | * Initialize the processor with the necessary assembler and repository instances. |
||
| 131 | * |
||
| 132 | * @param \TechDivision\Import\Dbal\Connection\ConnectionInterface $connection The connection to use |
||
| 133 | * @param \TechDivision\Import\Customer\Address\Assemblers\CustomerAddressAttributeAssemblerInterface $customerAddressAttributeAssembler The customer address attribute assembler to use |
||
| 134 | * @param \TechDivision\Import\Repositories\EavAttributeOptionValueRepositoryInterface $eavAttributeOptionValueRepository The EAV attribute option value repository to use |
||
| 135 | * @param \TechDivision\Import\Repositories\EavAttributeRepositoryInterface $eavAttributeRepository The EAV attribute repository to use |
||
| 136 | * @param \TechDivision\Import\Customer\Repositories\CustomerRepositoryInterface $customerRepository The customer repository to use |
||
| 137 | * @param \TechDivision\Import\Customer\Address\Repositories\CustomerAddressRepositoryInterface $customerAddressRepository The customer address repository to use |
||
| 138 | * @param \TechDivision\Import\Repositories\EavEntityTypeRepositoryInterface $eavEntityTypeRepository The EAV entity type repository to use |
||
| 139 | * @param \TechDivision\Import\Dbal\Actions\ActionInterface $customerAddressAction The customer address action to use |
||
| 140 | * @param \TechDivision\Import\Dbal\Actions\ActionInterface $customerAddressDatetimeAction The customer address datetime action to use |
||
| 141 | * @param \TechDivision\Import\Dbal\Actions\ActionInterface $customerAddressDecimalAction The customer address decimal action to use |
||
| 142 | * @param \TechDivision\Import\Dbal\Actions\ActionInterface $customerAddressIntAction The customer address integer action to use |
||
| 143 | * @param \TechDivision\Import\Dbal\Actions\ActionInterface $customerAddressTextAction The customer address text action to use |
||
| 144 | * @param \TechDivision\Import\Dbal\Actions\ActionInterface $customerAddressVarcharAction The customer address varchar action to use |
||
| 145 | */ |
||
| 146 | public function __construct( |
||
| 147 | ConnectionInterface $connection, |
||
| 148 | CustomerAddressAttributeAssemblerInterface $customerAddressAttributeAssembler, |
||
| 149 | EavAttributeOptionValueRepositoryInterface $eavAttributeOptionValueRepository, |
||
| 150 | EavAttributeRepositoryInterface $eavAttributeRepository, |
||
| 151 | CustomerRepositoryInterface $customerRepository, |
||
| 152 | CustomerAddressRepositoryInterface $customerAddressRepository, |
||
| 153 | EavEntityTypeRepositoryInterface $eavEntityTypeRepository, |
||
| 154 | ActionInterface $customerAddressAction, |
||
| 155 | ActionInterface $customerAddressDatetimeAction, |
||
| 156 | ActionInterface $customerAddressDecimalAction, |
||
| 157 | ActionInterface $customerAddressIntAction, |
||
| 158 | ActionInterface $customerAddressTextAction, |
||
| 159 | ActionInterface $customerAddressVarcharAction |
||
| 160 | ) { |
||
| 161 | $this->setConnection($connection); |
||
| 162 | $this->setCustomerAddressAttributeAssembler($customerAddressAttributeAssembler); |
||
| 163 | $this->setEavAttributeOptionValueRepository($eavAttributeOptionValueRepository); |
||
| 164 | $this->setEavAttributeRepository($eavAttributeRepository); |
||
| 165 | $this->setCustomerRepository($customerRepository); |
||
| 166 | $this->setCustomerAddressRepository($customerAddressRepository); |
||
| 167 | $this->setCustomerAddressAction($customerAddressAction); |
||
| 168 | $this->setCustomerAddressDatetimeAction($customerAddressDatetimeAction); |
||
| 169 | $this->setCustomerAddressDecimalAction($customerAddressDecimalAction); |
||
| 170 | $this->setCustomerAddressIntAction($customerAddressIntAction); |
||
| 171 | $this->setCustomerAddressTextAction($customerAddressTextAction); |
||
| 172 | $this->setCustomerAddressVarcharAction($customerAddressVarcharAction); |
||
| 173 | } |
||
| 174 | |||
| 175 | /** |
||
| 176 | * Set's the passed connection. |
||
| 177 | * |
||
| 178 | * @param \TechDivision\Import\Dbal\Connection\ConnectionInterface $connection The connection to set |
||
| 179 | * |
||
| 180 | * @return void |
||
| 181 | */ |
||
| 182 | public function setConnection(ConnectionInterface $connection) |
||
| 183 | { |
||
| 184 | $this->connection = $connection; |
||
| 185 | } |
||
| 186 | |||
| 187 | /** |
||
| 188 | * Return's the connection. |
||
| 189 | * |
||
| 190 | * @return \TechDivision\Import\Dbal\Connection\ConnectionInterface The connection instance |
||
| 191 | */ |
||
| 192 | public function getConnection() |
||
| 195 | } |
||
| 196 | |||
| 197 | /** |
||
| 198 | * Turns off autocommit mode. While autocommit mode is turned off, changes made to the database via the PDO |
||
| 199 | * object instance are not committed until you end the transaction by calling CustomerProcessor::commit(). |
||
| 200 | * Calling CustomerProcessor::rollBack() will roll back all changes to the database and return the connection |
||
| 201 | * to autocommit mode. |
||
| 202 | * |
||
| 203 | * @return boolean Returns TRUE on success or FALSE on failure |
||
| 204 | * @link http://php.net/manual/en/pdo.begintransaction.php |
||
| 205 | */ |
||
| 206 | public function beginTransaction() |
||
| 207 | { |
||
| 208 | return $this->connection->beginTransaction(); |
||
| 209 | } |
||
| 210 | |||
| 211 | /** |
||
| 212 | * Commits a transaction, returning the database connection to autocommit mode until the next call to |
||
| 213 | * CustomerProcessor::beginTransaction() starts a new transaction. |
||
| 214 | * |
||
| 215 | * @return boolean Returns TRUE on success or FALSE on failure |
||
| 216 | * @link http://php.net/manual/en/pdo.commit.php |
||
| 217 | */ |
||
| 218 | public function commit() |
||
| 219 | { |
||
| 220 | return $this->connection->commit(); |
||
| 221 | } |
||
| 222 | |||
| 223 | /** |
||
| 224 | * Rolls back the current transaction, as initiated by CustomerProcessor::beginTransaction(). |
||
| 225 | * |
||
| 226 | * If the database was set to autocommit mode, this function will restore autocommit mode after it has |
||
| 227 | * rolled back the transaction. |
||
| 228 | * |
||
| 229 | * Some databases, including MySQL, automatically issue an implicit COMMIT when a database definition |
||
| 230 | * language (DDL) statement such as DROP TABLE or CREATE TABLE is issued within a transaction. The implicit |
||
| 231 | * COMMIT will prevent you from rolling back any other changes within the transaction boundary. |
||
| 232 | * |
||
| 233 | * @return boolean Returns TRUE on success or FALSE on failure |
||
| 234 | * @link http://php.net/manual/en/pdo.rollback.php |
||
| 235 | */ |
||
| 236 | public function rollBack() |
||
| 237 | { |
||
| 238 | return $this->connection->rollBack(); |
||
| 239 | } |
||
| 240 | |||
| 241 | /** |
||
| 242 | * Set's the repository to load the customers with. |
||
| 243 | * |
||
| 244 | * @param \TechDivision\Import\Customer\Repositories\CustomerRepositoryInterface $customerRepository The repository instance |
||
| 245 | * |
||
| 246 | * @return void |
||
| 247 | */ |
||
| 248 | public function setCustomerRepository(CustomerRepositoryInterface $customerRepository) |
||
| 249 | { |
||
| 250 | $this->customerRepository = $customerRepository; |
||
| 251 | } |
||
| 252 | |||
| 253 | /** |
||
| 254 | * Return's the repository to load the customers with. |
||
| 255 | * |
||
| 256 | * @return \TechDivision\Import\Customer\Repositories\CustomerRepositoryInterface The repository instance |
||
| 257 | */ |
||
| 258 | public function getCustomerRepository() |
||
| 259 | { |
||
| 260 | return $this->customerRepository; |
||
| 261 | } |
||
| 262 | |||
| 263 | /** |
||
| 264 | * Set's the repository to load the customer addresses with. |
||
| 265 | * |
||
| 266 | * @param \TechDivision\Import\Customer\Address\Repositories\CustomerAddressRepositoryInterface $customerAddressRepository The repository instance |
||
| 267 | * |
||
| 268 | * @return void |
||
| 269 | */ |
||
| 270 | public function setCustomerAddressRepository(CustomerAddressRepositoryInterface $customerAddressRepository) |
||
| 271 | { |
||
| 272 | $this->customerAddressRepository = $customerAddressRepository; |
||
| 273 | } |
||
| 274 | |||
| 275 | /** |
||
| 276 | * Return's the repository to load the customer addresses with. |
||
| 277 | * |
||
| 278 | * @return \TechDivision\Import\Customer\Address\Repositories\CustomerAddressRepositoryInterface The repository instance |
||
| 279 | */ |
||
| 280 | public function getCustomerAddressRepository() |
||
| 281 | { |
||
| 282 | return $this->customerAddressRepository; |
||
| 283 | } |
||
| 284 | |||
| 285 | /** |
||
| 286 | * Set's the action with the customer address CRUD methods. |
||
| 287 | * |
||
| 288 | * @param \TechDivision\Import\Dbal\Actions\ActionInterface $customerAddressAction The action with the customer CRUD methods |
||
| 289 | * |
||
| 290 | * @return void |
||
| 291 | */ |
||
| 292 | public function setCustomerAddressAction(ActionInterface $customerAddressAction) |
||
| 293 | { |
||
| 294 | $this->customerAddressAction = $customerAddressAction; |
||
| 295 | } |
||
| 296 | |||
| 297 | /** |
||
| 298 | * Return's the action with the customer address CRUD methods. |
||
| 299 | * |
||
| 300 | * @return \TechDivision\Import\Dbal\Actions\ActionInterface The action instance |
||
| 301 | */ |
||
| 302 | public function getCustomerAddressAction() |
||
| 303 | { |
||
| 304 | return $this->customerAddressAction; |
||
| 305 | } |
||
| 306 | |||
| 307 | /** |
||
| 308 | * Set's the action with the customer address varchar attribute CRUD methods. |
||
| 309 | * |
||
| 310 | * @param \TechDivision\Import\Dbal\Actions\ActionInterface $customerAddressVarcharAction The action with the customer varchar attriute CRUD methods |
||
| 311 | * |
||
| 312 | * @return void |
||
| 313 | */ |
||
| 314 | public function setCustomerAddressVarcharAction(ActionInterface $customerAddressVarcharAction) |
||
| 315 | { |
||
| 316 | $this->customerAddressVarcharAction = $customerAddressVarcharAction; |
||
| 317 | } |
||
| 318 | |||
| 319 | /** |
||
| 320 | * Return's the action with the customer address varchar attribute CRUD methods. |
||
| 321 | * |
||
| 322 | * @return \TechDivision\Import\Dbal\Actions\ActionInterface The action instance |
||
| 323 | */ |
||
| 324 | public function getCustomerAddressVarcharAction() |
||
| 325 | { |
||
| 326 | return $this->customerAddressVarcharAction; |
||
| 327 | } |
||
| 328 | |||
| 329 | /** |
||
| 330 | * Set's the action with the customer address text attribute CRUD methods. |
||
| 331 | * |
||
| 332 | * @param \TechDivision\Import\Dbal\Actions\ActionInterface $customerAddressTextAction The action with the customer text attriute CRUD methods |
||
| 333 | * |
||
| 334 | * @return void |
||
| 335 | */ |
||
| 336 | public function setCustomerAddressTextAction(ActionInterface $customerAddressTextAction) |
||
| 337 | { |
||
| 338 | $this->customerAddressTextAction = $customerAddressTextAction; |
||
| 339 | } |
||
| 340 | |||
| 341 | /** |
||
| 342 | * Return's the action with the customer address text attribute CRUD methods. |
||
| 343 | * |
||
| 344 | * @return \TechDivision\Import\Dbal\Actions\ActionInterface The action instance |
||
| 345 | */ |
||
| 346 | public function getCustomerAddressTextAction() |
||
| 347 | { |
||
| 348 | return $this->customerAddressTextAction; |
||
| 349 | } |
||
| 350 | |||
| 351 | /** |
||
| 352 | * Set's the action with the customer address int attribute CRUD methods. |
||
| 353 | * |
||
| 354 | * @param \TechDivision\Import\Dbal\Actions\ActionInterface $customerAddressIntAction The action with the customer int attriute CRUD methods |
||
| 355 | * |
||
| 356 | * @return void |
||
| 357 | */ |
||
| 358 | public function setCustomerAddressIntAction(ActionInterface $customerAddressIntAction) |
||
| 359 | { |
||
| 360 | $this->customerAddressIntAction = $customerAddressIntAction; |
||
| 361 | } |
||
| 362 | |||
| 363 | /** |
||
| 364 | * Return's the action with the customer address int attribute CRUD methods. |
||
| 365 | * |
||
| 366 | * @return \TechDivision\Import\Dbal\Actions\ActionInterface The action instance |
||
| 367 | */ |
||
| 368 | public function getCustomerAddressIntAction() |
||
| 369 | { |
||
| 370 | return $this->customerAddressIntAction; |
||
| 371 | } |
||
| 372 | |||
| 373 | /** |
||
| 374 | * Set's the action with the customer address decimal attribute CRUD methods. |
||
| 375 | * |
||
| 376 | * @param \TechDivision\Import\Dbal\Actions\ActionInterface $customerAddressDecimalAction The action with the customer decimal attriute CRUD methods |
||
| 377 | * |
||
| 378 | * @return void |
||
| 379 | */ |
||
| 380 | public function setCustomerAddressDecimalAction(ActionInterface $customerAddressDecimalAction) |
||
| 381 | { |
||
| 382 | $this->customerAddressDecimalAction = $customerAddressDecimalAction; |
||
| 383 | } |
||
| 384 | |||
| 385 | /** |
||
| 386 | * Return's the action with the customer address decimal attribute CRUD methods. |
||
| 387 | * |
||
| 388 | * @return \TechDivision\Import\Dbal\Actions\ActionInterface The action instance |
||
| 389 | */ |
||
| 390 | public function getCustomerAddressDecimalAction() |
||
| 391 | { |
||
| 392 | return $this->customerAddressDecimalAction; |
||
| 393 | } |
||
| 394 | |||
| 395 | /** |
||
| 396 | * Set's the action with the customer address datetime attribute CRUD methods. |
||
| 397 | * |
||
| 398 | * @param \TechDivision\Import\Dbal\Actions\ActionInterface $customerAddressDatetimeAction The action with the customer datetime attriute CRUD methods |
||
| 399 | * |
||
| 400 | * @return void |
||
| 401 | */ |
||
| 402 | public function setCustomerAddressDatetimeAction(ActionInterface $customerAddressDatetimeAction) |
||
| 403 | { |
||
| 404 | $this->customerAddressDatetimeAction = $customerAddressDatetimeAction; |
||
| 405 | } |
||
| 406 | |||
| 407 | /** |
||
| 408 | * Return's the action with the customer address datetime attribute CRUD methods. |
||
| 409 | * |
||
| 410 | * @return \TechDivision\Import\Dbal\Actions\ActionInterface The action instance |
||
| 411 | */ |
||
| 412 | public function getCustomerAddressDatetimeAction() |
||
| 413 | { |
||
| 414 | return $this->customerAddressDatetimeAction; |
||
| 415 | } |
||
| 416 | |||
| 417 | /** |
||
| 418 | * Set's the repository to access EAV attribute option values. |
||
| 419 | * |
||
| 420 | * @param \TechDivision\Import\Repositories\EavAttributeOptionValueRepositoryInterface $eavAttributeOptionValueRepository The repository to access EAV attribute option values |
||
| 421 | * |
||
| 422 | * @return void |
||
| 423 | */ |
||
| 424 | public function setEavAttributeOptionValueRepository(EavAttributeOptionValueRepositoryInterface $eavAttributeOptionValueRepository) |
||
| 425 | { |
||
| 426 | $this->eavAttributeOptionValueRepository = $eavAttributeOptionValueRepository; |
||
| 427 | } |
||
| 428 | |||
| 429 | /** |
||
| 430 | * Return's the repository to access EAV attribute option values. |
||
| 431 | * |
||
| 432 | * @return \TechDivision\Import\Repositories\EavAttributeOptionValueRepositoryInterface The repository instance |
||
| 433 | */ |
||
| 434 | public function getEavAttributeOptionValueRepository() |
||
| 435 | { |
||
| 436 | return $this->eavAttributeOptionValueRepository; |
||
| 437 | } |
||
| 438 | |||
| 439 | /** |
||
| 440 | * Set's the repository to access EAV attributes. |
||
| 441 | * |
||
| 442 | * @param \TechDivision\Import\Repositories\EavAttributeRepositoryInterface $eavAttributeRepository The repository to access EAV attributes |
||
| 443 | * |
||
| 444 | * @return void |
||
| 445 | */ |
||
| 446 | public function setEavAttributeRepository(EavAttributeRepositoryInterface $eavAttributeRepository) |
||
| 447 | { |
||
| 448 | $this->eavAttributeRepository = $eavAttributeRepository; |
||
| 449 | } |
||
| 450 | |||
| 451 | /** |
||
| 452 | * Return's the repository to access EAV attributes. |
||
| 453 | * |
||
| 454 | * @return \TechDivision\Import\Repositories\EavAttributeRepositoryInterface The repository instance |
||
| 455 | */ |
||
| 456 | public function getEavAttributeRepository() |
||
| 457 | { |
||
| 458 | return $this->eavAttributeRepository; |
||
| 459 | } |
||
| 460 | |||
| 461 | /** |
||
| 462 | * Set's the repository to access EAV entity types. |
||
| 463 | * |
||
| 464 | * @param \TechDivision\Import\Repositories\EavEntityTypeRepositoryInterface $eavEntityTypeRepository The repository to access EAV entity types |
||
| 465 | * |
||
| 466 | * @return void |
||
| 467 | */ |
||
| 468 | public function setEavEntityTypeRepository(EavEntityTypeRepositoryInterface $eavEntityTypeRepository) |
||
| 469 | { |
||
| 470 | $this->eavEntityTypeRepository = $eavEntityTypeRepository; |
||
| 471 | } |
||
| 472 | |||
| 473 | /** |
||
| 474 | * Return's the repository to access EAV entity types. |
||
| 475 | * |
||
| 476 | * @return \TechDivision\Import\Repositories\EavEntityTypeRepositoryInterface The repository instance |
||
| 477 | */ |
||
| 478 | public function getEavEntityTypeRepository() |
||
| 479 | { |
||
| 480 | return $this->eavAttributeRepository; |
||
| 481 | } |
||
| 482 | |||
| 483 | /** |
||
| 484 | * Set's the assembler to load the customer address attributes with. |
||
| 485 | * |
||
| 486 | * @param \TechDivision\Import\Customer\Address\Assemblers\CustomerAddressAttributeAssemblerInterface $customerAddressAttributeAssembler The assembler instance |
||
| 487 | * |
||
| 488 | * @return void |
||
| 489 | */ |
||
| 490 | public function setCustomerAddressAttributeAssembler(CustomerAddressAttributeAssemblerInterface $customerAddressAttributeAssembler) |
||
| 491 | { |
||
| 492 | $this->customerAddressAttributeAssembler = $customerAddressAttributeAssembler; |
||
| 493 | } |
||
| 494 | |||
| 495 | /** |
||
| 496 | * Return's the assembler to load the customer address attributes with. |
||
| 497 | * |
||
| 498 | * @return \TechDivision\Import\Customer\Address\Assemblers\CustomerAddressAttributeAssemblerInterface The assembler instance |
||
| 499 | */ |
||
| 500 | public function getCustomerAddressAttributeAssembler() |
||
| 501 | { |
||
| 502 | return $this->customerAddressAttributeAssembler; |
||
| 503 | } |
||
| 504 | |||
| 505 | /** |
||
| 506 | * Return's an array with the available EAV attributes for the passed is user defined flag. |
||
| 507 | * |
||
| 508 | * @param integer $isUserDefined The flag itself |
||
| 509 | * |
||
| 510 | * @return array The array with the EAV attributes matching the passed flag |
||
| 511 | */ |
||
| 512 | public function getEavAttributeByIsUserDefined($isUserDefined = 1) |
||
| 513 | { |
||
| 514 | return $this->getEavAttributeRepository()->findAllByIsUserDefined($isUserDefined); |
||
| 515 | } |
||
| 516 | |||
| 517 | /** |
||
| 518 | * Intializes the existing attributes for the entity with the passed entity ID. |
||
| 519 | * |
||
| 520 | * @param integer $entityId The entity ID of the entity to load the attributes for |
||
| 521 | * |
||
| 522 | * @return array The entity attributes |
||
| 523 | */ |
||
| 524 | public function getCustomerAddressAttributesByEntityId($entityId) |
||
| 525 | { |
||
| 526 | return $this->getCustomerAddressAttributeAssembler()->getCustomerAddressAttributesByEntityId($entityId); |
||
| 527 | } |
||
| 528 | |||
| 529 | /** |
||
| 530 | * Load's and return's the EAV attribute option value with the passed entity type ID, code, store ID and value. |
||
| 531 | * |
||
| 532 | * @param string $entityTypeId The entity type ID of the EAV attribute to load the option value for |
||
| 533 | * @param string $attributeCode The code of the EAV attribute option to load |
||
| 534 | * @param integer $storeId The store ID of the attribute option to load |
||
| 535 | * @param string $value The value of the attribute option to load |
||
| 536 | * |
||
| 537 | * @return array The EAV attribute option value |
||
| 538 | */ |
||
| 539 | public function loadAttributeOptionValueByEntityTypeIdAndAttributeCodeAndStoreIdAndValue($entityTypeId, $attributeCode, $storeId, $value) |
||
| 540 | { |
||
| 541 | return $this->getEavAttributeOptionValueRepository()->findOneByEntityTypeIdAndAttributeCodeAndStoreIdAndValue($entityTypeId, $attributeCode, $storeId, $value); |
||
| 542 | } |
||
| 543 | |||
| 544 | /** |
||
| 545 | * Return's an EAV entity type with the passed entity type code. |
||
| 546 | * |
||
| 547 | * @param string $entityTypeCode The code of the entity type to return |
||
| 548 | * |
||
| 549 | * @return array The entity type with the passed entity type code |
||
| 550 | */ |
||
| 551 | public function loadEavEntityTypeByEntityTypeCode($entityTypeCode) |
||
| 552 | { |
||
| 553 | return $this->getEavEntityTypeRepository()->findOneByEntityTypeCode($entityTypeCode); |
||
| 554 | } |
||
| 555 | |||
| 556 | /** |
||
| 557 | * Return's the customer with the passed entity ID. |
||
| 558 | * |
||
| 559 | * @param integer $id The entity ID of the customer to return |
||
| 560 | * |
||
| 561 | * @return array|null The customer |
||
| 562 | */ |
||
| 563 | public function loadCustomerAddress($id) |
||
| 566 | } |
||
| 567 | |||
| 568 | |||
| 569 | /** |
||
| 570 | * Return's the customer with the passed increment ID. |
||
| 571 | * |
||
| 572 | * @param string|integer $incrementId The increment ID of the customer to return |
||
| 573 | * @param string|integer $customerId The entity_id of the customer |
||
| 574 | * |
||
| 575 | * @return array|null The customer |
||
| 576 | */ |
||
| 577 | public function loadCustomerAddressByIncrementId($incrementId, $customerId) |
||
| 578 | { |
||
| 579 | return $this->getCustomerAddressRepository()->loadByIncrementIdAndCustomerEntityId($incrementId, $customerId); |
||
| 580 | } |
||
| 581 | |||
| 582 | /** |
||
| 583 | * Return's the customer with the passed email and website ID. |
||
| 584 | * |
||
| 585 | * @param string $email The email of the customer to return |
||
| 586 | * @param string $websiteId The website ID of the customer to return |
||
| 587 | * |
||
| 588 | * @return array|null The customer |
||
| 589 | */ |
||
| 590 | public function loadCustomerByEmailAndWebsiteId($email, $websiteId) |
||
| 591 | { |
||
| 592 | return $this->getCustomerRepository()->findOneByEmailAndWebsiteId($email, $websiteId); |
||
| 593 | } |
||
| 594 | |||
| 595 | /** |
||
| 596 | * Persist's the passed customer address data and return's the ID. |
||
| 597 | * |
||
| 598 | * @param array $customerAddress The customer data to persist |
||
| 599 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 600 | * |
||
| 601 | * @return string The ID of the persisted entity |
||
| 602 | */ |
||
| 603 | public function persistCustomerAddress($customerAddress, $name = null) |
||
| 604 | { |
||
| 605 | return $this->getCustomerAddressAction()->persist($customerAddress, $name); |
||
| 606 | } |
||
| 607 | |||
| 608 | /** |
||
| 609 | * Persist's the passed customer address varchar attribute. |
||
| 610 | * |
||
| 611 | * @param array $attribute The attribute to persist |
||
| 612 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 613 | * |
||
| 614 | * @return void |
||
| 615 | */ |
||
| 616 | public function persistCustomerAddressVarcharAttribute($attribute, $name = null) |
||
| 617 | { |
||
| 618 | $this->getCustomerAddressVarcharAction()->persist($attribute, $name); |
||
| 619 | } |
||
| 620 | |||
| 621 | /** |
||
| 622 | * Persist's the passed customer address integer attribute. |
||
| 623 | * |
||
| 624 | * @param array $attribute The attribute to persist |
||
| 625 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 626 | * |
||
| 627 | * @return void |
||
| 628 | */ |
||
| 629 | public function persistCustomerAddressIntAttribute($attribute, $name = null) |
||
| 630 | { |
||
| 631 | $this->getCustomerAddressIntAction()->persist($attribute, $name); |
||
| 632 | } |
||
| 633 | |||
| 634 | /** |
||
| 635 | * Persist's the passed customer address decimal attribute. |
||
| 636 | * |
||
| 637 | * @param array $attribute The attribute to persist |
||
| 638 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 639 | * |
||
| 640 | * @return void |
||
| 641 | */ |
||
| 642 | public function persistCustomerAddressDecimalAttribute($attribute, $name = null) |
||
| 643 | { |
||
| 644 | $this->getCustomerAddressDecimalAction()->persist($attribute, $name); |
||
| 645 | } |
||
| 646 | |||
| 647 | /** |
||
| 648 | * Persist's the passed customer address datetime attribute. |
||
| 649 | * |
||
| 650 | * @param array $attribute The attribute to persist |
||
| 651 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 652 | * |
||
| 653 | * @return void |
||
| 654 | */ |
||
| 655 | public function persistCustomerAddressDatetimeAttribute($attribute, $name = null) |
||
| 656 | { |
||
| 657 | $this->getCustomerAddressDatetimeAction()->persist($attribute, $name); |
||
| 658 | } |
||
| 659 | |||
| 660 | /** |
||
| 661 | * Persist's the passed customer address text attribute. |
||
| 662 | * |
||
| 663 | * @param array $attribute The attribute to persist |
||
| 664 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 665 | * |
||
| 666 | * @return void |
||
| 667 | */ |
||
| 668 | public function persistCustomerAddressTextAttribute($attribute, $name = null) |
||
| 669 | { |
||
| 670 | $this->getCustomerAddressTextAction()->persist($attribute, $name); |
||
| 671 | } |
||
| 672 | |||
| 673 | /** |
||
| 674 | * Delete's the entity with the passed attributes. |
||
| 675 | * |
||
| 676 | * @param array $row The attributes of the entity to delete |
||
| 677 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 678 | * |
||
| 679 | * @return void |
||
| 680 | */ |
||
| 681 | public function deleteCustomerAddress($row, $name = null) |
||
| 682 | { |
||
| 683 | $this->getCustomerAddressAction()->delete($row, $name); |
||
| 684 | } |
||
| 685 | |||
| 686 | /** |
||
| 687 | * Delete's the customer address datetime attribute with the passed attributes. |
||
| 688 | * |
||
| 689 | * @param array $row The attributes of the entity to delete |
||
| 690 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 691 | * |
||
| 692 | * @return void |
||
| 693 | */ |
||
| 694 | public function deleteCustomerAddressDatetimeAttribute($row, $name = null) |
||
| 695 | { |
||
| 696 | $this->getCustomerAddressDatetimeAction()->delete($row, $name); |
||
| 697 | } |
||
| 698 | |||
| 699 | /** |
||
| 700 | * Delete's the customer address decimal attribute with the passed attributes. |
||
| 701 | * |
||
| 702 | * @param array $row The attributes of the entity to delete |
||
| 703 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 704 | * |
||
| 705 | * @return void |
||
| 706 | */ |
||
| 707 | public function deleteCustomerAddressDecimalAttribute($row, $name = null) |
||
| 710 | } |
||
| 711 | |||
| 712 | /** |
||
| 713 | * Delete's the customer address integer attribute with the passed attributes. |
||
| 714 | * |
||
| 715 | * @param array $row The attributes of the entity to delete |
||
| 716 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 717 | * |
||
| 718 | * @return void |
||
| 719 | */ |
||
| 720 | public function deleteCustomerAddressIntAttribute($row, $name = null) |
||
| 721 | { |
||
| 722 | $this->getCustomerAddressIntAction()->delete($row, $name); |
||
| 723 | } |
||
| 724 | |||
| 725 | /** |
||
| 726 | * Delete's the customer address text attribute with the passed attributes. |
||
| 727 | * |
||
| 728 | * @param array $row The attributes of the entity to delete |
||
| 729 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 730 | * |
||
| 731 | * @return void |
||
| 732 | */ |
||
| 733 | public function deleteCustomerAddressTextAttribute($row, $name = null) |
||
| 734 | { |
||
| 735 | $this->getCustomerAddressTextAction()->delete($row, $name); |
||
| 736 | } |
||
| 737 | |||
| 738 | /** |
||
| 739 | * Delete's the customer address varchar attribute with the passed attributes. |
||
| 740 | * |
||
| 741 | * @param array $row The attributes of the entity to delete |
||
| 742 | * @param string|null $name The name of the prepared statement that has to be executed |
||
| 743 | * |
||
| 744 | * @return void |
||
| 745 | */ |
||
| 746 | public function deleteCustomerAddressVarcharAttribute($row, $name = null) |
||
| 749 | } |
||
| 750 | |||
| 751 | /** |
||
| 752 | * Clean-Up the repositories to free memory. |
||
| 753 | * |
||
| 754 | * @return void |
||
| 755 | */ |
||
| 756 | public function cleanUp() |
||
| 761 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths