Components/Table.php
public function setDefaultIdentifierFieldNames()
    {
        //Default identifier for table rows
        $rootEntity = $this->queryBuilder->getRootEntities()[0];
        $metadata = $this->queryBuilder->getEntityManager()->getMetadataFactory()->getMetadataFor($rootEntity);
        $identifiers = array();
        foreach ($metadata->getIdentifierFieldNames() as $identifierFieldName) {
            $identifiers[] = $this->getAlias().'.'.$identifierFieldName;
        }
        $rootEntityIdentifier = implode(',', $identifiers);
        $this->setIdentifierFieldNames($rootEntityIdentifier ?: null);

        return $this;
    }
public function setDefaultIdentifierFieldNames()
    {
        //Default identifier for table rows
        $rootEntity = $this->queryBuilder->getRootEntities()[0];
        $metadata = $this->queryBuilder->getEntityManager()->getMetadataFactory()->getMetadataFor($rootEntity);
        $identifiers = array();
        foreach ($metadata->getIdentifierFieldNames() as $identifierFieldName) {
            $identifiers[] = $this->getAlias().'.'.$identifierFieldName;
        }
        $rootEntityIdentifier = implode(',', $identifiers);
        $this->setIdentifierFieldNames($rootEntityIdentifier ?: null);

        return $this;
    }
public function setDefaultIdentifierFieldNames ( ) { //Default identifier for table rows $ rootEntity = $ this -> queryBuilder -> getRootEntities ( ) [ 0 ] ; $ metadata = $ this -> queryBuilder -> getEntityManager ( ) -> getMetadataFactory ( ) -> getMetadataFor ( $ rootEntity ) ; $ identifiers = array ( ) ; foreach ( $ metadata -> getIdentifierFieldNames ( ) as $ identifierFieldName ) { $ identifiers [ ] = $ this -> getAlias ( ) . '.' . $ identifierFieldName ; } $ rootEntityIdentifier = implode ( ',' , $ identifiers ) ; $ this -> setIdentifierFieldNames ( $ rootEntityIdentifier ? : null ) ; return $ this ; }
Defines default identifiers from query builder in order to optimize count queries.

@return $this

@throws \Doctrine\Common\Persistence\Mapping\MappingException
Defines default identifiers from query builder in order to optimize count queries .