Ejemplo n.º 1
0
 /**
  * @param DatagridConfiguration $config
  *
  * @return string|null
  */
 protected function getEntity(DatagridConfiguration $config)
 {
     if ($this->entityClassName === null) {
         $this->entityClassName = $this->gridConfigurationHelper->getEntity($config);
     }
     return $this->entityClassName;
 }
 /**
  * @param DatagridConfiguration $config
  *
  * @return string
  */
 protected function getDataIdentifier(DatagridConfiguration $config)
 {
     $entity = $this->getEntity($config);
     $identifier = $this->doctrineHelper->getSingleEntityIdentifierFieldName($entity);
     $rootAlias = $this->gridConfigurationHelper->getEntityRootAlias($config);
     return sprintf('%s.%s', $rootAlias, $identifier);
 }
 /**
  * @dataProvider getDatagridConfigurationDataProvider
  *
  * @param array $param
  */
 public function testGetRootAlias($param)
 {
     $config = DatagridConfiguration::create($param);
     $this->assertEquals(self::ENTITY_ALIAS, $this->gridConfigurationHelper->getEntityRootAlias($config));
 }