mootensai\enhancedgii\BaseGenerator::validateTableName PHP Method

validateTableName() public method

Validates the [[tableName]] attribute.
public validateTableName ( )
    public function validateTableName()
    {
        if (strpos($this->tableName, '*') !== false && substr_compare($this->tableName, '*', -1, 1)) {
            $this->addError('tableName', 'Asterisk is only allowed as the last character.');
            return;
        }
        $tables = $this->getTableNames();
        if (empty($tables)) {
            $this->addError('tableName', "Table '{$this->tableName}' does not exist.");
        } else {
            foreach ($tables as $table) {
                $class = $this->generateClassName($table);
                if ($this->isReservedKeyword($class)) {
                    $this->addError('tableName', "Table '{$table}' will generate a class which is a reserved PHP keyword.");
                    break;
                }
            }
        }
    }