protected function bindDataset($dataset)
    {
        $datasetClass = $this->datasetClass;
        $object = new $datasetClass();

        if ($object instanceof DataSetInterface) {
            return $object->bind($dataset);
        }

        if ($dataset instanceof \Traversable) {
            $dataset = iterator_to_array($dataset);
        } elseif (is_object($dataset)) {
            $dataset = [$dataset];
        } elseif (!is_array($dataset)) {
            throw new \InvalidArgumentException(sprintf('Need an array or object in %s::%s()', __CLASS__, __METHOD__));
        }

        foreach ($dataset as $data) {
            $object[] = $data;
        }

        return $object;
    }