/** * Preprocess change product class * * @return void */ protected function preprocessChangeProductClass() { if ($this->productClass) { foreach ($this->productClass->getAttributes() as $a) { $class = $a->getAttributeValueClass($a->getType()); $repo = \XLite\Core\Database::getRepo($class); foreach ($repo->findBy(array('product' => $this, 'attribute' => $a)) as $v) { $repo->delete($v); } } } }
/** * {@inheritDoc} */ public function getAttributes() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getAttributes', array()); return parent::getAttributes(); }