/** * @return Specification[]|array */ public function getSpecifications() { if (!isset($this->_cache['specifications']) || array_key_exists('specifications', $this->_cache) === false) { $this->_cache['specifications'] = []; foreach ($this->getAttribute('specifications') as $specification) { $productSpecEntity = new Specification(); $productSpecEntity->setClient($this->getClient()); $productSpecEntity->setId($specification['_id']); $productSpecEntity->setAttributes($specification); $entity = $productSpecEntity; $this->_cache['specifications'][] = $entity; } } return $this->_cache['specifications']; }