/** * This attribute is multiple or not flag * * @param \XLite\Model\Product $product Product * * @return boolean */ public function isMultiple(\XLite\Model\Product $product) { $repo = \XLite\Core\Database::getRepo(static::getAttributeValueClass($this->getType())); return (!$this->getProduct() || $this->getProduct()->getId() == $product->getId()) && (!$this->getProductClass() || $product->getProductClass() && $this->getProductClass()->getId() == $product->getProductClass()->getId()) && 1 < count($repo->findBy(array('product' => $product, 'attribute' => $this))); }
/** * {@inheritDoc} */ public function getId() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getId', array()); return parent::getId(); }