Sets the foreign table name.

@param string $foreignTableName The foreign table name.

@throws \Fridge\DBAL\Exception\SchemaException If the foreign table name is not a valid string.
188603
public function setForeignTableName($foreignTableName)
    {
        if (!is_string($foreignTableName) || (strlen($foreignTableName) <= 0)) {
            throw SchemaException::invalidForeignKeyForeignTableName($this->getName());
        }

        $this->foreignTableName = $foreignTableName;
    }
1163498
public function setTableName($tableName)
    {
        $this->tableName = $tableName;
        $this->setPrefix($this->generatePrefix($tableName));
        return $this;
    }
206126
public function addTable(Table $table)
    {
        if ($this->hasTable($table->getName())) {
            throw SchemaException::schemaTableAlreadyExists($this->getName(), $table->getName());
        }

        $this->tables[$table->getName()] = $table;

        if ($table->getSchema() !== $this) {
            $table->setSchema($this);
        }
    }
832989
public function setDbName($dbName = null)
    {
        $this->dbName = (null === $dbName ? Propel::getServiceContainer()->getDefaultDatasource() : $dbName);
    }
1148850
public static function add_foreign_key($table, $foreign_key)
	{
		if ( ! is_array($foreign_key))
		{
			throw new InvalidArgumentException('Foreign key for add_foreign_key() must be specified as an array');
		}

		$sql = 'ALTER TABLE ';
		$sql .= \DB::quote_identifier(\DB::table_prefix($table, static::$connection)).' ';
		$sql .= 'ADD ';
		$sql .= ltrim(static::process_foreign_keys(array($foreign_key)), ',');

		return \DB::query($sql, \DB::UPDATE)->execute();
	}
1293942
public function setTableName($table)
    {
        if ($this->sql) {
            if ($this->validateToken($table)) {
                $this->table = $table;
                return true;
            } else {
                throw new SimpleCache_Exception("`$table` is not a valid table name");
            }
        }
        return false;
    }
475867
public function setName($name)
    {
        list($domain, $locale, $extention) = explode('.', $name);

        $this->domain = $domain;
        $this->locale = $locale;
        $this->extention = $extention;
    }
1181867
public function createForeignKey(ForeignKeyConstraint $foreignKey, $table)
    {
        $this->_execSql($this->_platform->getCreateForeignKeySQL($foreignKey, $table));
    }
383328
public function setFromName($fieldName)
    {
        if (empty($this->name)) {
            $this->name = $fieldName;
        }
        $this->attrName = $this->getAttrName();
        $this->concrete = false === empty($this->getColumnName());

        if (empty($this->verboseName)) {
            $this->verboseName = ucwords(
                str_replace(
                    '_',
                    ' ',
                    $this->name
                )
            );
        }
    }
349434
public function setAutoIncrement($autoIncrement)
    {
        if (($autoIncrement !== null) && !is_bool($autoIncrement)) {
            throw SchemaException::invalidColumnAutoIncrementFlag($this->getName());
        }

        $this->autoIncrement = $autoIncrement;
    }
669213
public function renameColumn($oldName, $newName)
    {
        if (!$this->hasColumn($oldName)) {
            throw SchemaException::tableColumnDoesNotExist($this->getName(), $oldName);
        }

        if ($this->hasColumn($newName)) {
            throw SchemaException::tableColumnAlreadyExists($this->getName(), $newName);
        }

        $this->columns[$oldName]->setName($newName);
        $this->columns[$newName] = $this->columns[$oldName];
        unset($this->columns[$oldName]);
    }
213215
public function setNameFromTable()
    {
        $fullName = '';
        $upperCase = true;
        for ($i = 0; $i < strlen($this->table); $i++) {
            $character = $this->table[$i];

            if ($character === '_') {
                $upperCase = true;
            } else {
                $fullName .= $upperCase ? strtoupper($character) : $character;
                $upperCase = false;
            }
        }

        if (substr($fullName, -3) === 'ies') {
            $fullName = substr($fullName, 0, -3) . 'y';
        } elseif (substr($fullName, -3) === 'ses') {
            $fullName = substr($fullName, 0, -3) . 's';
        } elseif (substr($fullName, -1) === 's') {
            $fullName = substr($fullName, 0, -1);
        }

        $this->name = $fullName;
        return $this;
    }
1041304
public function setModel($model, $foreignKey, $foreignKeyIds)
    {
        $this->model = $model;
        $this->foreignKey = $foreignKey;
        $this->foreignKeyIds = array_wrap($foreignKeyIds);

        $this->message = "Integrity constraint violation [{$model}] where $foreignKey in (".implode(', ', $foreignKeyIds).')';

        return $this;
    }
1254112
public function foreign(
        $table,
        $localColumnNames,
        $foreignColumnNames = 'id',
        $options = [],
        $constraintName = null
    ) {
        $localColumnNames   = is_array($localColumnNames) ? $localColumnNames : [$localColumnNames];
        $foreignColumnNames = is_array($foreignColumnNames) ? $foreignColumnNames : [$foreignColumnNames];

        return $this->table->addForeignKeyConstraint($table, $localColumnNames, $foreignColumnNames, $options,
            $constraintName);
    }
753819
public function from($table, ...$tables)
    {
        array_unshift($tables, $table);

        foreach ($tables as $table) {
            list($tableAlias, $tableName) = $this->dialect()->parseTable($table);

            if ($tableName instanceof SelectQuery) {
                if (!$tableAlias) {
                    throw new SqlException('FROM derived table should have an alias name.');
                }

                $tableKey = $tableAlias;
            } else {
                $tableKey = $tableAlias ?: $tableName;

                $tableName = $this->dialect()->quoteTable($tableName);
            }

            if ($tableAlias) {
                $tableAlias = $this->dialect()->quoteName($tableAlias);
            }

            $this->addFrom($tableKey, $tableName, $tableAlias);
        }

        return $this;
    }
357965
private function getFieldNameForColumn($tableName, $columnName, $fk = false)
    {
        if (isset($this->fieldNamesForColumns[$tableName], $this->fieldNamesForColumns[$tableName][$columnName])) {
            return $this->fieldNamesForColumns[$tableName][$columnName];
        }

        $columnName = strtolower($columnName);

        // Replace _id if it is a foreignkey column
        if ($fk) {
            $columnName = str_replace('_id', '', $columnName);
        }

        return Inflector::camelize($columnName);
    }
218341
public function createForeignKey($foreignKey, $table)
    {
        $changeSetElt = $this->createChangeSet('create-foreign-keys-' . $table->getName());
        $addForeignKeyConstraintElt = $this->document->createElement('addForeignKeyConstraint');

        $this->fillForeignKeyAttributes($addForeignKeyConstraintElt, $foreignKey, $table);

        $changeSetElt->appendChild($addForeignKeyConstraintElt);
        $this->root->appendChild($changeSetElt);
    }