protected function _addSearch(\Doctrine\ORM\QueryBuilder $queryBuilder)
    {
        if ($this->search == TRUE)
        {
            $request       = $this->request;
            $search_fields = array_values($this->fields);
            foreach ($search_fields as $i => $search_field)
            {
                $search_param = $request->get("sSearch_{$i}");
                if ($search_param !== false && $search_param != '')
                {
                    $field        = explode(' ', trim($search_field));
                    $search_field = $field[0];

                    $queryBuilder->andWhere(" $search_field like :ssearch{$i} ");
                    $queryBuilder->setParameter("ssearch{$i}", '%' . $request->get("sSearch_{$i}") . '%');
                }
            }
        }
    }
protected function _addSearch(\Doctrine\ORM\QueryBuilder $queryBuilder)
    {
        if ($this->search == TRUE)
        {
            $request       = $this->request;
            $search_fields = array_values($this->fields);
            foreach ($search_fields as $i => $search_field)
            {
                $search_param = $request->get("sSearch_{$i}");
                if ($search_param !== false && $search_param != '')
                {
                    $field        = explode(' ', trim($search_field));
                    $search_field = $field[0];

                    $queryBuilder->andWhere(" $search_field like :ssearch{$i} ");
                    $queryBuilder->setParameter("ssearch{$i}", '%' . $request->get("sSearch_{$i}") . '%');
                }
            }
        }
    }
protected function _addSearch ( \ Doctrine \ ORM \ QueryBuilder $ queryBuilder ) { if ( $ this -> search == TRUE ) { $ request = $ this -> request ; $ search_fields = array_values ( $ this -> fields ) ; foreach ( $ search_fields as $ i => $ search_field ) { $ search_param = $ request -> get ( "sSearch_{$i}" ) ; if ( $ search_param !== false && $ search_param != '' ) { $ field = explode ( ' ' , trim ( $ search_field ) ) ; $ search_field = $ field [ 0 ] ; $ queryBuilder -> andWhere ( " $search_field like :ssearch{$i} " ) ; $ queryBuilder -> setParameter ( "ssearch{$i}" , '%' . $ request -> get ( "sSearch_{$i}" ) . '%' ) ; } } } }
get the search dql

@return string
get the search dql