Esempio n. 1
0
 /**
  * @param ResourceInterface $resource
  * @param mixed[]           $config
  */
 private function configureResource(ResourceInterface $resource, array $config)
 {
     $driverConfig = $config['driver'];
     $mappingConfig = $driverConfig['mapping'];
     $resource->setModel($config['model']);
     $resource->setDriver(isset($driverConfig['name']) ? $driverConfig['name'] : null);
     $resource->setDriverManager(isset($driverConfig['manager']) ? $driverConfig['manager'] : null);
     $resource->setDriverMappingPath(isset($mappingConfig['path']) ? $mappingConfig['path'] : null);
     $resource->setDriverMappingFormat(isset($mappingConfig['format']) ? $mappingConfig['format'] : null);
     $resource->setRepository(isset($config['repository']) ? $config['repository'] : null);
     $resource->setFactory(isset($config['factory']) ? $config['factory'] : null);
     $resource->setForm(isset($config['form']) ? $config['form'] : null);
     $resource->setChoiceForm(isset($config['choice_form']) ? $config['choice_form'] : null);
     $resource->setDomainManager(isset($config['domain_manager']) ? $config['domain_manager'] : null);
     $resource->setController(isset($config['controller']) ? $config['controller'] : null);
     $resource->setIdPropertyPath(isset($config['id_property_path']) ? $config['id_property_path'] : null);
     $resource->setLabelPropertyPath(isset($config['label_property_path']) ? $config['label_property_path'] : null);
 }