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