public function filterByFunc($cb)
    {
        //method filters the collection using the given callback, keeping only those rows that pass a given truth test
        $dstore = new DataStore;
        $dstore->meta($this->metaData);
        foreach ($this->rows as $index=>$row) {
            if ($cb($row, $index)===true) {
                $dstore->append($row);
            }
        }
        return $dstore;
    }
public function filterByFunc($cb)
    {
        //method filters the collection using the given callback, keeping only those rows that pass a given truth test
        $dstore = new DataStore;
        $dstore->meta($this->metaData);
        foreach ($this->rows as $index=>$row) {
            if ($cb($row, $index)===true) {
                $dstore->append($row);
            }
        }
        return $dstore;
    }
public function filterByFunc ( $ cb ) { //method filters the collection using the given callback, keeping only those rows that pass a given truth test $ dstore = new DataStore ; $ dstore -> meta ( $ this -> metaData ) ; foreach ( $ this -> rows as $ index => $ row ) { if ( $ cb ( $ row , $ index ) === true ) { $ dstore -> append ( $ row ) ; } } return $ dstore ; }
Get filtered results by function

A row will go through if function return true

@param function $cb Callback function

@return DataSore New datastore containing filtered results.
Get filtered results by function