system/Database/Query/QueryBuilder.php
/**
     * Add soft deletes on a query if enabled
     *
     * @return void
     */
Add soft deletes on a query if enabled
@return void
Add soft deletes on a query if enabled @return void
protected function addSoftDeletes()
    {
        $stmt = $this->db->prepare("DESCRIBE {$this->tableName}");
        $stmt->execute();
        $columns = array();
        $stmt->setFetchMode(PDO::FETCH_ASSOC);
        while($row = $stmt->fetch()){
            $columns[] = $row['Field'];
        }
        if(in_array('deleted_at', $columns))
        {
            if($this->is_where)
            {
                $this->query .= " AND {$this->tableName}.deleted_at IS NULL";
            }else {
                $this->is_where = true;
                $this->query .= " AND {$this->tableName}.deleted_at IS NULL";
            }
        }
        if(!empty(trim($this->orderby)))
        {
            $this->query .= $this->orderby;
        }
    }
protected function addSoftDeletes ( ) { $ stmt = $ this -> db -> prepare ( " DESCRIBE  { $ this -> tableName } " ) ; $ stmt -> execute ( ) ; $ columns = array ( ) ; $ stmt -> setFetchMode ( PDO :: FETCH_ASSOC ) ; while ( $ row = $ stmt -> fetch ( ) ) { $ columns [ ] = $ row [ 'Field' ] ; } if ( in_array ( 'deleted_at' , $ columns ) ) { if ( $ this -> is_where ) { $ this -> query .= "  AND  { $ this -> tableName } .deleted_at IS NULL " ; } else { $ this -> is_where = true ; $ this -> query .= "  AND  { $ this -> tableName } .deleted_at IS NULL " ; } } if ( ! empty ( trim ( $ this -> orderby ) ) ) { $ this -> query .= $ this -> orderby ; } }
Add soft deletes on a query if enabled
 @return void
Add soft deletes on a query if enabled @return void