Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 public function getMetadata()
 {
     $metadata = parent::getMetadata();
     $defaultScope = $this->userContext->getUserChannel();
     $metadata['populateDefault'] = false;
     unset($metadata['placeholder']);
     return $metadata;
 }
 /**
  * {@inheritdoc}
  */
 public function getMetadata()
 {
     $metadata = parent::getMetadata();
     $defaultScope = $this->userContext->getUserChannel();
     $metadata['populateDefault'] = true;
     $metadata['placeholder'] = $defaultScope->getLabel();
     $metadata['choices'] = array_filter($metadata['choices'], function ($choice) use($defaultScope) {
         return $choice['value'] !== $defaultScope->getCode();
     });
     return $metadata;
 }