src/Sulu/Component/Rest/Listing/ListQueryBuilder.php
private function getSelectFrom($prefix = 'u')
    {
        $this->joins = '';
        $this->prefixes = [$prefix];

        // select and where fields
        $fieldsWhere = array_merge(
            (null != $this->fields) ? $this->fields : [],
            array_keys($this->where)
        );

        $fieldsWhere = array_merge($fieldsWhere, $this->searchTextFields, $this->searchNumberFields);

        if (null != $fieldsWhere && count($fieldsWhere) >= 0) {
            foreach ($fieldsWhere as $field) {
                $this->performSelectFromField($field, $prefix);
            }
        }
        // if no field is selected take prefix
        if (true === $this->countQuery) {
            $this->select = $this->replaceSelect;
        } elseif (0 == strlen($this->select)) {
            $this->select = $prefix;
        }

        $dql = 'SELECT %s
                FROM %s %s
                  %s';

        return sprintf($dql, $this->select, $this->entityName, $prefix, $this->joins);
    }
private function getSelectFrom($prefix = 'u')
    {
        $this->joins = '';
        $this->prefixes = [$prefix];

        // select and where fields
        $fieldsWhere = array_merge(
            (null != $this->fields) ? $this->fields : [],
            array_keys($this->where)
        );

        $fieldsWhere = array_merge($fieldsWhere, $this->searchTextFields, $this->searchNumberFields);

        if (null != $fieldsWhere && count($fieldsWhere) >= 0) {
            foreach ($fieldsWhere as $field) {
                $this->performSelectFromField($field, $prefix);
            }
        }
        // if no field is selected take prefix
        if (true === $this->countQuery) {
            $this->select = $this->replaceSelect;
        } elseif (0 == strlen($this->select)) {
            $this->select = $prefix;
        }

        $dql = 'SELECT %s
                FROM %s %s
                  %s';

        return sprintf($dql, $this->select, $this->entityName, $prefix, $this->joins);
    }
private function getSelectFrom ( $ prefix = 'u' ) { $ this -> joins = '' ; $ this -> prefixes = [ $ prefix ] ; // select and where fields $ fieldsWhere = array_merge ( ( null != $ this -> fields ) ? $ this -> fields : [ ] , array_keys ( $ this -> where ) ) ; $ fieldsWhere = array_merge ( $ fieldsWhere , $ this -> searchTextFields , $ this -> searchNumberFields ) ; if ( null != $ fieldsWhere && count ( $ fieldsWhere ) >= 0 ) { foreach ( $ fieldsWhere as $ field ) { $ this -> performSelectFromField ( $ field , $ prefix ) ; } } // if no field is selected take prefix if ( true === $ this -> countQuery ) { $ this -> select = $ this -> replaceSelect ; } elseif ( 0 == strlen ( $ this -> select ) ) { $ this -> select = $ prefix ; } $ dql = 'SELECT %s
                FROM %s %s
                  %s' ; return sprintf ( $ dql , $ this -> select , $ this -> entityName , $ prefix , $ this -> joins ) ; }
Create a Select ... From ... Statement for given fields with joins.

@param string $prefix

@return string
Create a Select ... From ... Statement for given fields with joins .