public function bind($dataset)
    {
        if ($dataset === null) {
            return $this;
        }

        if ($dataset instanceof \Traversable) {
            $dataset = iterator_to_array($dataset);
        } elseif (is_object($dataset)) {
            $dataset = [$dataset];
        } elseif (!is_array($dataset)) {
            throw new \InvalidArgumentException('Need an array or object');
        }

        foreach ($dataset as $k => $data) {
            $this[$k] = $data;
        }

        return $this;
    }
public function bind($dataset)
    {
        if ($dataset === null) {
            return $this;
        }

        if ($dataset instanceof \Traversable) {
            $dataset = iterator_to_array($dataset);
        } elseif (is_object($dataset)) {
            $dataset = [$dataset];
        } elseif (!is_array($dataset)) {
            throw new \InvalidArgumentException('Need an array or object');
        }

        foreach ($dataset as $k => $data) {
            $this[$k] = $data;
        }

        return $this;
    }
public function bind ( $ dataset ) { if ( $ dataset === null ) { return $ this ; } if ( $ dataset instanceof \ Traversable ) { $ dataset = iterator_to_array ( $ dataset ) ; } elseif ( is_object ( $ dataset ) ) { $ dataset = [ $ dataset ] ; } elseif ( ! is_array ( $ dataset ) ) { throw new \ InvalidArgumentException ( 'Need an array or object' ) ; } foreach ( $ dataset as $ k => $ data ) { $ this [ $ k ] = $ data ; } return $ this ; }
Bind data array into self.

@param array $dataset An array of multiple data.

@throws \InvalidArgumentException
@return  DataSet Return self to support chaining.
Bind data array into self .