public function testDefinitionsInflectable()
 {
     /** @var AbstractSortDefinition $definition */
     foreach ($this->collection as $definition) {
         $map = $this->ormInflector->getTable($definition->getTableName())->getMap();
         $this->assertNotEmpty($map->getOrmValue($definition->getFieldName()), $definition->getUniqueIdentifier() . ' - not mapped');
     }
 }
 public function testMap()
 {
     $map = $this->ormInflector->getTable('s_articles')->getMap();
     $this->assertInstanceOf('Shopware\\SwagDefaultSort\\Components\\ORMReflector\\Map', $map);
     $this->assertEquals('main_detail_id', $map->getDbValue('mainDetailId'));
     $this->assertEquals('mainDetailId', $map->getOrmValue('main_detail_id'));
     $this->assertArrayHasKey('main_detail_id', $map->getOrmIterator());
     $this->assertArrayHasKey('mainDetailId', $map->getDbIterator());
 }
 /**
  * @return AbstractSortDefinition[]
  */
 public function createDefinitions()
 {
     $inflectionResult = $this->inflector->getTable($this->getTableName());
     $ret = [];
     foreach ($inflectionResult->getFieldNames() as $fieldName) {
         if (in_array($fieldName, $this->blacklist)) {
             continue;
         }
         $ret[] = new GenericDefinition($fieldName, $this);
     }
     return $ret;
 }
 private function getOrmFieldName(AbstractSortDefinition $definition)
 {
     return $this->ormReflector->getTable($definition->getTable()->getTableName())->getMap()->getOrmValue($definition->getFieldName());
 }