Bundle/CoreBundle/Repository/StateFullRepositoryTrait.php
public function getInstance($alias = null)
    {
        if (!$alias && !$this->mainAlias) {
            $namespace = explode('\\', $this->_entityName);
            $alias = strtolower(end($namespace));
            $this->mainAlias = $alias;
        } elseif ($alias) {
            $this->mainAlias = $alias;
        }

        return $this->qb ? $this->qb : $this->qb = $this->createQueryBuilder($this->mainAlias);
    }
public function getInstance($alias = null)
    {
        if (!$alias && !$this->mainAlias) {
            $namespace = explode('\\', $this->_entityName);
            $alias = strtolower(end($namespace));
            $this->mainAlias = $alias;
        } elseif ($alias) {
            $this->mainAlias = $alias;
        }

        return $this->qb ? $this->qb : $this->qb = $this->createQueryBuilder($this->mainAlias);
    }
public function getInstance ( $ alias = null ) { if ( ! $ alias && ! $ this -> mainAlias ) { $ namespace = explode ( '\\' , $ this -> _entityName ) ; $ alias = strtolower ( end ( $ namespace ) ) ; $ this -> mainAlias = $ alias ; } elseif ( $ alias ) { $ this -> mainAlias = $ alias ; } return $ this -> qb ? $ this -> qb : $ this -> qb = $ this -> createQueryBuilder ( $ this -> mainAlias ) ; }
Get query builder instance.

@param string $alias The entity alias

@return QueryBuilder The active or default query builder
Get query builder instance .