public function setTable($table)
    {
        if (is_array($table)) {
            if (!isset($table['name'])) {
                throw new \InvalidArgumentException('A name key is required when passing an array to setTable()');
            }
            $this->table = $table['name'];
        } else {
            $this->table = $table;
        }
    }