|
@@ 92-106 (lines=15) @@
|
| 89 |
|
* @throws \Exception Is thrown, if the entity ID has not been mapped |
| 90 |
|
* @see \TechDivision\Import\Product\Subjects\BunchSubject::getVisibilityIdByValue() |
| 91 |
|
*/ |
| 92 |
|
public function getEntityIdVisibilityIdMapping() |
| 93 |
|
{ |
| 94 |
|
|
| 95 |
|
// query whether or not the SKU has already been mapped to it's visibility |
| 96 |
|
if (isset($this->entityIdVisibilityIdMapping[$entityId = $this->getLastEntityId()])) { |
| 97 |
|
return $this->entityIdVisibilityIdMapping[$entityId]; |
| 98 |
|
} |
| 99 |
|
|
| 100 |
|
// throw a new exception |
| 101 |
|
throw new \Exception( |
| 102 |
|
$this->appendExceptionSuffix( |
| 103 |
|
sprintf('Can\'t find visibility mapping for entity ID "%d"', $entityId) |
| 104 |
|
) |
| 105 |
|
); |
| 106 |
|
} |
| 107 |
|
|
| 108 |
|
/** |
| 109 |
|
* Add the entity ID => visibility mapping for the actual entity ID. |
|
@@ 128-142 (lines=15) @@
|
| 125 |
|
* @return boolean TRUE if the store is active, else FALSE |
| 126 |
|
* @throws \Exception Is thrown, if the store with the actual code is not available |
| 127 |
|
*/ |
| 128 |
|
public function storeIsActive($storeViewCode) |
| 129 |
|
{ |
| 130 |
|
|
| 131 |
|
// query whether or not, the requested store is available |
| 132 |
|
if (isset($this->stores[$storeViewCode])) { |
| 133 |
|
return 1 === (integer) $this->stores[$storeViewCode][MemberNames::IS_ACTIVE]; |
| 134 |
|
} |
| 135 |
|
|
| 136 |
|
// throw an exception, if not |
| 137 |
|
throw new \Exception( |
| 138 |
|
$this->appendExceptionSuffix( |
| 139 |
|
sprintf('Found invalid store view code %s', $storeViewCode) |
| 140 |
|
) |
| 141 |
|
); |
| 142 |
|
} |
| 143 |
|
} |
| 144 |
|
|