function it_creates_an_attribute_with_type($registry, AbstractAttributeType $attributeType)
 {
     $attributeType->getBackendType()->willReturn('backend_type');
     $attributeType->getName()->willReturn('name_type');
     $registry->get('pim_catalogue_text')->willReturn($attributeType);
     $this->createAttribute('pim_catalogue_text')->shouldReturnAnInstanceOf(self::ATTRIBUTE_CLASS);
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 protected function defineCustomAttributeProperties(AttributeInterface $attribute)
 {
     $properties = parent::defineCustomAttributeProperties($attribute) + ['numberMin' => ['name' => 'numberMin', 'fieldType' => 'pim_number'], 'numberMax' => ['name' => 'numberMax', 'fieldType' => 'pim_number'], 'decimalsAllowed' => ['name' => 'decimalsAllowed', 'fieldType' => 'switch', 'options' => ['attr' => $attribute->getId() ? [] : ['checked' => 'checked']]], 'negativeAllowed' => ['name' => 'negativeAllowed', 'fieldType' => 'switch', 'options' => ['attr' => $attribute->getId() ? [] : ['checked' => 'checked']]]];
     $properties['unique']['options']['disabled'] = (bool) $attribute->getId();
     $properties['unique']['options']['read_only'] = (bool) $attribute->getId();
     return $properties;
 }
Exemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 protected function defineCustomAttributeProperties(AbstractAttribute $attribute)
 {
     $properties = parent::defineCustomAttributeProperties($attribute) + ['defaultValue' => ['name' => 'defaultValue'], 'maxCharacters' => ['name' => 'maxCharacters', 'fieldType' => 'text'], 'validationRule' => ['name' => 'validationRule', 'fieldType' => 'choice', 'options' => ['choices' => [null => 'None', 'email' => 'E-mail', 'url' => 'URL', 'regexp' => 'Regular expression'], 'select2' => true]], 'validationRegexp' => ['name' => 'validationRegexp']];
     $properties['unique']['options']['disabled'] = (bool) $attribute->getId();
     $properties['unique']['options']['read_only'] = (bool) $attribute->getId();
     return $properties;
 }
Exemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 protected function defineCustomAttributeProperties(AbstractAttribute $attribute)
 {
     $properties = parent::defineCustomAttributeProperties($attribute) + ['defaultValue' => ['name' => 'defaultValue', 'fieldType' => 'oro_date', 'options' => ['widget' => 'single_text']], 'dateMin' => ['name' => 'dateMin', 'fieldType' => 'oro_date', 'options' => ['widget' => 'single_text']], 'dateMax' => ['name' => 'dateMax', 'fieldType' => 'oro_date', 'options' => ['widget' => 'single_text']]];
     $properties['unique']['options']['disabled'] = (bool) $attribute->getId();
     $properties['unique']['options']['read_only'] = (bool) $attribute->getId();
     return $properties;
 }
 /**
  * {@inheritdoc}
  */
 protected function defineCustomAttributeProperties(AttributeInterface $attribute)
 {
     $attributes = parent::defineCustomAttributeProperties($attribute);
     unset($attributes['availableLocales'], $attributes['unique']);
     return $attributes + ['reference_data_name' => ['name' => 'reference_data_name', 'fieldType' => 'choice', 'options' => ['choices' => $this->getReferenceDataTypeChoices(), 'required' => true, 'multiple' => false, 'empty_value' => 'pim_enrich.reference_data.empty_value.reference_data_type.label', 'select2' => true]]];
 }
Exemplo n.º 6
0
 /**
  * {@inheritdoc}
  */
 protected function defineCustomAttributeProperties(AttributeInterface $attribute)
 {
     return parent::defineCustomAttributeProperties($attribute) + ['maxFileSize' => ['name' => 'maxFileSize', 'fieldType' => 'pim_number'], 'allowedExtensions' => ['name' => 'allowedExtensions', 'data' => implode(',', $attribute->getAllowedExtensions()), 'options' => ['by_reference' => false, 'select2' => true, 'attr' => ['data-tags' => 'doc,docx,rtf,txt,csv,ppt,pptx,mp3,wav,svg,pdf']]]];
 }
 /**
  * {@inheritdoc}
  */
 protected function defineCustomAttributeProperties(AbstractAttribute $attribute)
 {
     return parent::defineCustomAttributeProperties($attribute) + ['minimumInputLength' => ['name' => 'minimumInputLength', 'fieldType' => 'pim_number'], 'options' => ['name' => 'options', 'fieldType' => 'pim_enrich_options'], 'autoOptionSorting' => ['name' => 'autoOptionSorting', 'fieldType' => 'switch', 'options' => ['label' => 'Automatic option sorting', 'property_path' => 'properties[autoOptionSorting]', 'help' => 'info.attribute.auto option sorting', 'attr' => ['class' => 'hide']]]];
 }
Exemplo n.º 8
0
 /**
  * {@inheritdoc}
  */
 protected function defineCustomAttributeProperties(AttributeInterface $attribute)
 {
     return parent::defineCustomAttributeProperties($attribute) + ['maxCharacters' => ['name' => 'maxCharacters', 'fieldType' => 'text'], 'wysiwygEnabled' => ['name' => 'wysiwygEnabled', 'fieldType' => 'switch']];
 }
Exemplo n.º 9
0
 /**
  * {@inheritdoc}
  */
 protected function defineCustomAttributeProperties(AttributeInterface $attribute)
 {
     return parent::defineCustomAttributeProperties($attribute) + ['maxFileSize' => ['name' => 'maxFileSize', 'fieldType' => 'pim_number'], 'allowedExtensions' => ['name' => 'allowedExtensions', 'data' => implode(',', $attribute->getAllowedExtensions()), 'options' => ['by_reference' => false, 'select2' => true, 'attr' => ['data-tags' => 'tif,tiff,gif,jpeg,jpg,jif,jfif,png,pdf,psd']]]];
 }
 /**
  * {@inheritdoc}
  */
 protected function defineCustomAttributeProperties(AbstractAttribute $attribute)
 {
     return parent::defineCustomAttributeProperties($attribute) + ['numberMin' => ['name' => 'numberMin', 'fieldType' => 'pim_number'], 'numberMax' => ['name' => 'numberMax', 'fieldType' => 'pim_number'], 'decimalsAllowed' => ['name' => 'decimalsAllowed', 'fieldType' => 'switch', 'options' => ['attr' => $attribute->getId() ? [] : ['checked' => 'checked']]]];
 }
Exemplo n.º 11
0
 /**
  * {@inheritdoc}
  */
 public function prepareValueFormOptions(ProductValueInterface $value)
 {
     $options = parent::prepareValueFormOptions($value);
     $options['decimals_allowed'] = $value->getAttribute()->isDecimalsAllowed();
     return $options;
 }
Exemplo n.º 12
0
 /**
  * {@inheritdoc}
  */
 protected function defineCustomAttributeProperties(AttributeInterface $attribute)
 {
     return parent::defineCustomAttributeProperties($attribute) + ['numberMin' => ['name' => 'numberMin', 'fieldType' => 'pim_number'], 'numberMax' => ['name' => 'numberMax', 'fieldType' => 'pim_number'], 'decimalsAllowed' => ['name' => 'decimalsAllowed', 'fieldType' => 'switch', 'options' => ['attr' => $attribute->getId() ? [] : ['checked' => 'checked']]], 'negativeAllowed' => ['name' => 'negativeAllowed', 'fieldType' => 'switch', 'options' => ['attr' => $attribute->getId() ? [] : ['checked' => 'checked']]], 'metricFamily' => ['name' => 'metricFamily', 'options' => ['required' => true, 'disabled' => (bool) $attribute->getId(), 'read_only' => (bool) $attribute->getId()]], 'defaultMetricUnit' => ['name' => 'defaultMetricUnit', 'options' => ['required' => true]]];
 }
Exemplo n.º 13
0
 /**
  * {@inheritdoc}
  */
 protected function defineCustomAttributeProperties(AbstractAttribute $attribute)
 {
     return parent::defineCustomAttributeProperties($attribute) + ['defaultValue' => ['name' => 'defaultValue', 'fieldType' => 'switch']];
 }
Exemplo n.º 14
0
 /**
  * {@inheritdoc}
  */
 protected function defineCustomAttributeProperties(AbstractAttribute $attribute)
 {
     return parent::defineCustomAttributeProperties($attribute) + ['defaultValue' => ['name' => 'defaultValue', 'fieldType' => 'textarea'], 'maxCharacters' => ['name' => 'maxCharacters', 'fieldType' => 'text'], 'wysiwygEnabled' => ['name' => 'wysiwygEnabled', 'fieldType' => 'switch']];
 }