public function find($withAll=false)
    {
        $instance = (isset($this)) ? $this : new static;
        
        // One time setting reset mechanism
        if ($instance->_cleanNextFind === true) {
            // Reset alias
            $instance->setAlias(null);
        } else {
            // Turn on clean for next find
            $instance->_cleanNextFind = true;
        }
        
        // Alias option for FROM
        $sqlFrom = ($instance->alias) ? "{$instance->table} AS {$instance->alias}" : $instance->table;
        
        $instance->_dbr->from($sqlFrom);

        // WithAll helper
        if ($withAll===true) {
            $instance->withAll();
        }

        // Scope condition
        $instance->_addGlobalScopeCondition();

        // Soft Deleted condition
        $instance->_addSoftDeletedCondition();

        return $instance->_dbr;
    }
public function find($withAll=false)
    {
        $instance = (isset($this)) ? $this : new static;
        
        // One time setting reset mechanism
        if ($instance->_cleanNextFind === true) {
            // Reset alias
            $instance->setAlias(null);
        } else {
            // Turn on clean for next find
            $instance->_cleanNextFind = true;
        }
        
        // Alias option for FROM
        $sqlFrom = ($instance->alias) ? "{$instance->table} AS {$instance->alias}" : $instance->table;
        
        $instance->_dbr->from($sqlFrom);

        // WithAll helper
        if ($withAll===true) {
            $instance->withAll();
        }

        // Scope condition
        $instance->_addGlobalScopeCondition();

        // Soft Deleted condition
        $instance->_addSoftDeletedCondition();

        return $instance->_dbr;
    }
public function find ( $ withAll = false ) { $ instance = ( isset ( $ this ) ) ? $ this : new static ; // One time setting reset mechanism if ( $ instance -> _cleanNextFind === true ) { // Reset alias $ instance -> setAlias ( null ) ; } else { // Turn on clean for next find $ instance -> _cleanNextFind = true ; } // Alias option for FROM $ sqlFrom = ( $ instance -> alias ) ? "{$instance->table} AS {$instance->alias}" : $ instance -> table ; $ instance -> _dbr -> from ( $ sqlFrom ) ; // WithAll helper if ( $ withAll === true ) { $ instance -> withAll ( ) ; } // Scope condition $ instance -> _addGlobalScopeCondition ( ) ; // Soft Deleted condition $ instance -> _addSoftDeletedCondition ( ) ; return $ instance -> _dbr ; }
Create an existent CI Query Builder instance with Model features for query purpose.

@param boolean $withAll withAll() switch helper
@return object CI_DB_query_builder
@example
$posts = $this->PostModel->find()
->where('is_public', '1')
->limit(0,25)
->order_by('id')
->get()
->result_array();
@example
// Without all featured conditions for next find()
$posts = $this->PostModel->find(true)
->where('is_deleted', '1')
->get()
->result_array();
// This is equal to withAll() method
$this->PostModel->withAll()->find();
Create an existent CI Query Builder instance with Model features for query purpose .