| @@ 165-181 (lines=17) @@ | ||
| 162 | * |
|
| 163 | * @return array The EAV attribute option values |
|
| 164 | */ |
|
| 165 | public function findAllByEntityTypeIdAndStoreId($entityTypeId, $storeId) |
|
| 166 | { |
|
| 167 | ||
| 168 | // the parameters of the EAV attribute option to load |
|
| 169 | $params = array( |
|
| 170 | MemberNames::ENTITY_TYPE_ID => $entityTypeId, |
|
| 171 | MemberNames::STORE_ID => $storeId, |
|
| 172 | ); |
|
| 173 | ||
| 174 | // load and return all available EAV attribute option values by the passed params |
|
| 175 | $this->eavAttributeOptionValuesByEntityTypeIdAndStoreIdStmt->execute($params); |
|
| 176 | ||
| 177 | // fetch the values and return them |
|
| 178 | while ($record = $this->eavAttributeOptionValuesByEntityTypeIdAndStoreIdStmt->fetch(\PDO::FETCH_ASSOC)) { |
|
| 179 | yield $record; |
|
| 180 | } |
|
| 181 | } |
|
| 182 | ||
| 183 | /** |
|
| 184 | * Load's and return's the EAV attribute option value with the passed option ID and store ID |
|
| @@ 125-137 (lines=13) @@ | ||
| 122 | * |
|
| 123 | * @return array The EAV attribute |
|
| 124 | */ |
|
| 125 | public function findOneByEntityTypeIdAndAttributeCode($entityTypeId, $attributeCode) |
|
| 126 | { |
|
| 127 | ||
| 128 | // initialize the params |
|
| 129 | $params = array( |
|
| 130 | MemberNames::ENTITY_TYPE_ID => $entityTypeId, |
|
| 131 | MemberNames::ATTRIBUTE_CODE => $attributeCode |
|
| 132 | ); |
|
| 133 | ||
| 134 | // execute the prepared statement and return the EAV attribute with the passed entity type ID and code |
|
| 135 | $this->eavAttributeByEntityTypeIdAndAttributeCodeStmt->execute($params); |
|
| 136 | return $this->eavAttributeByEntityTypeIdAndAttributeCodeStmt->fetch(\PDO::FETCH_ASSOC); |
|
| 137 | } |
|
| 138 | ||
| 139 | /** |
|
| 140 | * Return's an array with the available EAV attributes for the passed entity type ID and attribute set name. |
|
| @@ 138-150 (lines=13) @@ | ||
| 135 | * |
|
| 136 | * @return array The EAV attribute set |
|
| 137 | */ |
|
| 138 | public function findOneByEntityTypeIdAndAttributeSetName($entityTypeId, $attributeSetName) |
|
| 139 | { |
|
| 140 | ||
| 141 | // initialize the params |
|
| 142 | $params = array( |
|
| 143 | MemberNames::ENTITY_TYPE_ID => $entityTypeId, |
|
| 144 | MemberNames::ATTRIBUTE_SET_NAME => $attributeSetName |
|
| 145 | ); |
|
| 146 | ||
| 147 | // load and return the attribute set |
|
| 148 | $this->eavAttributeSetByEntityTypeIdAndAttributeSetNameStmt->execute($params); |
|
| 149 | return $this->eavAttributeSetByEntityTypeIdAndAttributeSetNameStmt->fetch(\PDO::FETCH_ASSOC); |
|
| 150 | } |
|
| 151 | ||
| 152 | /** |
|
| 153 | * Load's and return's the EAV attribute set with the passed entity type code and attribute set name. |
|