public function only()
    {
        //Only colname
        $cols = func_get_args();
        $dstore = new DataStore;

        foreach ($this->rows as $row) {
            $new_row = array();
            foreach ($cols as $col) {
                $new_row[$col] = $row[$col];
            }
            $dstore->push($new_row);
        }
        $columnsMeta = Utility::get($this->metaData, "columns");
        $newColumnsMeta = array();
        if ($columnsMeta) {
            foreach ($cols as $col) {
                $newColumnsMeta[$col] = $columnsMeta[$col];
            }
        }
        $dstore->meta(array("columns"=>$newColumnsMeta));
        return $dstore;
    }
public function only()
    {
        //Only colname
        $cols = func_get_args();
        $dstore = new DataStore;

        foreach ($this->rows as $row) {
            $new_row = array();
            foreach ($cols as $col) {
                $new_row[$col] = $row[$col];
            }
            $dstore->push($new_row);
        }
        $columnsMeta = Utility::get($this->metaData, "columns");
        $newColumnsMeta = array();
        if ($columnsMeta) {
            foreach ($cols as $col) {
                $newColumnsMeta[$col] = $columnsMeta[$col];
            }
        }
        $dstore->meta(array("columns"=>$newColumnsMeta));
        return $dstore;
    }
public function only ( ) { //Only colname $ cols = func_get_args ( ) ; $ dstore = new DataStore ; foreach ( $ this -> rows as $ row ) { $ new_row = array ( ) ; foreach ( $ cols as $ col ) { $ new_row [ $ col ] = $ row [ $ col ] ; } $ dstore -> push ( $ new_row ) ; } $ columnsMeta = Utility :: get ( $ this -> metaData , "columns" ) ; $ newColumnsMeta = array ( ) ; if ( $ columnsMeta ) { foreach ( $ cols as $ col ) { $ newColumnsMeta [ $ col ] = $ columnsMeta [ $ col ] ; } } $ dstore -> meta ( array ( "columns" => $ newColumnsMeta ) ) ; return $ dstore ; }
Get new datastore containing some of the columns

Examples:

$newStore = $store->only("name","age");

@return DataStore New datastore containing result
Get new datastore containing some of the columns