Exemplo n.º 1
0
 /**
  * Retrieve backend model by field code
  *
  * @param string $code
  * @return File
  * @throws LocalizedException
  */
 protected function getBackendModel($code)
 {
     $metadata = $this->metadataProvider->get();
     if (!(isset($metadata[$code]) && isset($metadata[$code]['backend_model']))) {
         throw new LocalizedException(__('Backend model is not specified for %1', $code));
     }
     return $this->backendModelFactory->createByPath($metadata[$code]['path']);
 }
Exemplo n.º 2
0
 /**
  * Retrieve metadata
  *
  * @return array
  */
 protected function getMetadata()
 {
     if (!$this->metadata) {
         $this->metadata = $this->metadataProvider->get();
         array_walk($this->metadata, function (&$value) {
             $value = $value['path'];
         });
     }
     return $this->metadata;
 }