예제 #1
0
 /**
  * Retrieve list of locked fields for attribute
  *
  * @param AbstractAttribute $attribute
  * @return array
  */
 public function getLockedFields(AbstractAttribute $attribute)
 {
     $allFields = $this->get($attribute->getEntityType()->getEntityTypeCode() . '/attributes/' . $attribute->getAttributeCode());
     if (!is_array($allFields)) {
         return [];
     }
     $lockedFields = [];
     foreach (array_keys($allFields) as $fieldCode) {
         $lockedFields[$fieldCode] = $fieldCode;
     }
     return $lockedFields;
 }
예제 #2
0
 public function setValue($value = null, $fromDb = false)
 {
     if ($fromDb) {
         $value = $this->datetime($value)->format('Y-m-d');
     }
     return parent::setValue($value, $fromDb);
 }
 /**
  * @return array
  */
 protected function getChoiceUrlParams()
 {
     return ['class' => $this->optionRepoClass, 'dataLocale' => $this->userContext->getCurrentLocaleCode(), 'collectionId' => $this->attribute->getId()];
 }
 /**
  * {@inheritdoc}
  */
 public function supportAttribute(AbstractAttribute $attribute)
 {
     return in_array($attribute->getAttributeType(), array('acme_catalog_color'));
 }