src/Charcoal/Source/DatabaseSource.php
public function setTable($table)
    {
        if (!is_string($table)) {
            throw new InvalidArgumentException(sprintf(
                'DatabaseSource::setTable() expects a string as table. (%s given). [%s]',
                gettype($table),
                get_class($this->model())
            ));
        }

        /**
         * For security reason, only alphanumeric characters (+ underscores)
         * are valid table names; Although SQL can support more,
         * there's really no reason to.
         */
        if (!preg_match('/[A-Za-z0-9_]/', $table)) {
            throw new InvalidArgumentException(sprintf(
                'Table name "%s" is invalid: must be alphanumeric / underscore.',
                $table
            ));
        }

        $this->table = $table;
        return $this;
    }
public function setTable($table)
    {
        if (!is_string($table)) {
            throw new InvalidArgumentException(sprintf(
                'DatabaseSource::setTable() expects a string as table. (%s given). [%s]',
                gettype($table),
                get_class($this->model())
            ));
        }

        /**
         * For security reason, only alphanumeric characters (+ underscores)
         * are valid table names; Although SQL can support more,
         * there's really no reason to.
         */
        if (!preg_match('/[A-Za-z0-9_]/', $table)) {
            throw new InvalidArgumentException(sprintf(
                'Table name "%s" is invalid: must be alphanumeric / underscore.',
                $table
            ));
        }

        $this->table = $table;
        return $this;
    }
public function setTable ( $ table ) { if ( ! is_string ( $ table ) ) { throw new InvalidArgumentException ( sprintf ( 'DatabaseSource::setTable() expects a string as table. (%s given). [%s]' , gettype ( $ table ) , get_class ( $ this -> model ( ) ) ) ) ; } /**
         * For security reason, only alphanumeric characters (+ underscores)
         * are valid table names; Although SQL can support more,
         * there's really no reason to.
         */ if ( ! preg_match ( '/[A-Za-z0-9_]/' , $ table ) ) { throw new InvalidArgumentException ( sprintf ( 'Table name "%s" is invalid: must be alphanumeric / underscore.' , $ table ) ) ; } $ this -> table = $ table ; return $ this ; }
Set the database's table to use.

@param  string $table The source table.
@throws InvalidArgumentException If argument is not a string or alphanumeric/underscore.
@return self
Set the database s table to use .