Sets the data source as a previous table.

@param string $tableName

@return GroupedTableDefiner
@throws InvalidArgumentException
503908
public function fromPreviousTable(string $tableName) : GroupedTableDefiner
    {
        if (!isset($this->previousTables[$tableName])) {
            throw InvalidArgumentException::format(
                'Invalid table name supplied to %s: expecting one of (%s), \'%s\' given',
                __METHOD__, Debug::formatValues(array_keys($this->previousTables)), $tableName
            );
        }

        return new GroupedTableDefiner($this->name, $this->callback, $this->previousTables[$tableName]->getDataSource());
    }
375994
public function update($tableName, array $properties)
    {
        $capsules = $this->all();

        foreach ($capsules as $capsule) {
            if ($capsule->tableName == $tableName) {
                $capsule = new MigrationTrackerCapsule($properties);
            }
        }

        return $this;
    }
1345467
public function getTableMetadata(string $tableName): TableMetadata
    {
        if (!array_key_exists($tableName, $this->tableMetadataList)) {
            throw new \RuntimeException('Database "' . $this->databaseName . '" doesn\'t contain table "' . $tableName . '"');
        }

        return $this->tableMetadataList[$tableName];
    }
781444
public function setFieldName($fieldName)
    {
        if (!is_string($fieldName) || $fieldName === '') {
            throw new InvalidArgumentException('"Field name" argument must be a string and must not empty.');
        }

        $this->fieldName = $fieldName;

        return $this;
    }
689601
final public function getTable(string $name): Table
    {
        if (!array_key_exists($name, $this->tables)) {
            throw new InvalidArgumentException('Table '.$name.' not added');
        }

        return $this->tables[$name];
    }
31660
public static function findRelationsTable($tableName)
    {
        return self::find()
            ->innerJoin(TagRelation::tableName(), '{{%admin_tag_relation}}.tag_id={{%admin_tag}}.id')
            ->where(['table_name' => TaggableTrait::cleanBaseTableName($tableName)])
            ->indexBy('name')
            ->distinct()
            ->all();
    }
185671
protected function getTableDefaults($tableName)
  {
    if (!isset($this->tableDefaults[$tableName]))
    {
      $this->loadTable($tableName);
    }
    return $this->tableDefaults[$tableName];
  }
1190549
public function listTableDetails($tableName)
    {
        $columns     = $this->listTableColumns($tableName);
        $foreignKeys = [];
        if ($this->_platform->supportsForeignKeyConstraints()) {
            $foreignKeys = $this->listTableForeignKeys($tableName);
        }
        $indexes = $this->listTableIndexes($tableName);

        return new Table($tableName, $columns, $indexes, $foreignKeys);
    }
1136023
public function getTable($tableName)
    {
        $table = new Table($tableName);

        $columns = $this->_getColumns($tableName);
        foreach ($columns as $col) {
            $table->addColumn($this->_createColumn($col));
        }

        $constraints = $this->_getConstraints($tableName);
        foreach ($constraints as $constraint) {
            $object = $this->_createConstraint($constraint);
            if ($object) {
                $table->addConstraint($object);
            }
        }

        return $table;
    }
1298009
public function getTableColumns($tableName) {
        if (!$this->tableColumns){
            if (App::get()->cacheExists('mpf:PDOConnection:tableColumns')){
                $this->tableColumns = App::get()->cacheValue('mpf:PDOConnection:tableColumns');
            }
        }
        if (!isset($this->tableColumns[$tableName])) {
            $this->tableColumns[$tableName] = $this->queryAssoc("SHOW COLUMNS FROM `$tableName`");
            App::get()->cacheSet('mpf:PDOConnection:tableColumns', $this->tableColumns);
        }
        return $this->tableColumns[$tableName];
    }
749094
public function setDataSource($source)
	{
		$this->dataModel = new DataModel($source, $this->primary_key);

		$this->dataModel->onBeforeFilter[] = [$this, 'beforeDataModelFilter'];
		$this->dataModel->onAfterFilter[] = [$this, 'afterDataModelFilter'];
		$this->dataModel->onAfterPaginated[] = [$this, 'afterDataModelPaginated'];

		return $this;
	}
76494
public function listTableColumns(string $tableName) : array
    {
        $tableName = $this->tableMaybeInvalid($tableName);
        return $this
            ->getSchemaManager()
            ->listTableColumns($tableName);
    }
1072852
public function tableSeed($tableName, $callback)
    {
        if (! is_array($callback) && ! ($callback instanceof \Closure)) {
            throw InvalidArgumentPassedException::isNotArrayOrClosure();    
        }

        $this->setTableName($tableName);

        // Make sure to flush the old seed query index
        // to avoid collision with the new incoming value.
        $this->flushSeedQueryIndex();

        if ($callback instanceof \Closure) {
            $obj = (object) array();
            $callback = (array) $callback($obj);
        }

        $seeds = array();
        foreach ($callback as $column => $value) {
            $seeds[$column] = $value;
        }

        $this->setSeedQueryIndex($this->totalSeedQueries());
        $this->setSeedQuery('table', $this->getTableNamePrefix($this->getTableName()));
        $this->setSeedQuery('record', $seeds);

        return $this;
    }
1331648
public function setModelName($modelName)
    {
        if (0 === strpos($modelName, '\\')) {
            $this->modelName = substr($modelName, 1);
        } else {
            $this->modelName = $modelName;
        }
        if ($this->modelName && !$this->modelTableMapName) {
            $this->modelTableMapName = constant($this->modelName . '::TABLE_MAP');
        }
        if (!$this->tableMap && $this->modelName) {
            $this->tableMap = Propel::getServiceContainer()->getDatabaseMap($this->getDbName())->getTableByPhpName($this->modelName);
        }

        return $this;
    }
321021
public function setName($name)
    {
        if ($this->_targetTable !== null) {
            $alias = $this->_targetTable->getAlias();
            if ($alias !== $name) {
                throw new InvalidArgumentException('Association name does not match target table alias.');
            }
        }

        $this->_name = $name;

        return $this;
    }
34140
public function setDatabaseName($databaseName = "")
    {
        if (empty($databaseName)) {
            throw new GdgCommonsInvalidArgumentException("Database name must not be null or empty");
        }
        
        if (!is_string($databaseName)) {
            throw new GdgCommonsInvalidArgumentException("Database name must be string");
        }
        
        $this->_databaseName = $databaseName;
    }
557782
public function withParentIdAs(string $columnName)
    {
        call_user_func($this->callback, function ($idString, Table $parentTable) use ($columnName) {
            /** @var IEntityMapper $mapper */
            $mapper = call_user_func($this->mapperLoader);
            $mapper->addForeignKey(ForeignKey::createWithNamingConvention(
                $mapper->getPrimaryTableName(),
                [$columnName],
                $parentTable->getName(),
                [$parentTable->getPrimaryKeyColumnName()],
                $this->identifying
                    ? ForeignKeyMode::CASCADE
                    : ForeignKeyMode::SET_NULL,
                ForeignKeyMode::CASCADE
            ));

            if ($this->orderPersistColumn) {
                $persistHook = new OrderIndexPropertyLoaderHook(
                    $mapper->getObjectType(),
                    $mapper->getPrimaryTable(),
                    $this->orderPersistColumn,
                    $columnName,
                    $mapper->getDefinition()->getPropertyLinkedToColumn($this->orderPersistColumn)
                );

                $mapper->addPersistHook($persistHook);
                $persistHookId = $persistHook->getIdString();
            } else {
                $persistHookId = null;
            }

            return new ToManyRelation(
                $idString,
                $this->loadIds
                    ? new ToManyRelationIdentityReference($mapper, $this->bidirectionalRelationProperty)
                    : new ToManyRelationObjectReference($mapper, $this->bidirectionalRelationProperty, $persistHookId),
                $columnName,
                $this->identifying
                    ? new IdentifyingRelationMode()
                    : new NonIdentifyingRelationMode(),
                $this->orderByColumnNameDirectionMap,
                $this->orderPersistColumn
            );
        });
    }