public function filter(\Closure $fn)
    {
        $data = array_filter($this->data, $fn);
        $records = $this->db->init($this->table, array(), $this->isNew);
        $records->data = $data;
        $records->isColl = true;
        $records->loaded = $this->loaded;
        return $records;
    }
public function filter(\Closure $fn)
    {
        $data = array_filter($this->data, $fn);
        $records = $this->db->init($this->table, array(), $this->isNew);
        $records->data = $data;
        $records->isColl = true;
        $records->loaded = $this->loaded;
        return $records;
    }
public function filter ( \ Closure $ fn ) { $ data = array_filter ( $ this -> data , $ fn ) ; $ records = $ this -> db -> init ( $ this -> table , array ( ) , $ this -> isNew ) ; $ records -> data = $ data ; $ records -> isColl = true ; $ records -> loaded = $ this -> loaded ; return $ records ; }
Filters elements of the collection using a callback function

@param \Closure $fn
@return $this
Filters elements of the collection using a callback function