Get a Doctrine Schema Column instance.
public getDoctrineColumn ( string $table, string $column ) : Doctrine\DBAL\Schema\Column | ||
$table | string | |
$column | string | |
Результат | Doctrine\DBAL\Schema\Column |
/** * Compile a rename column command. * * @param \Illuminate\Database\Schema\Blueprint $blueprint * @param \Illuminate\Support\Fluent $command * @param \Illuminate\Database\Connection $connection * @return array */ public function compileRenameColumn(Blueprint $blueprint, Fluent $command, Connection $connection) { $schema = $connection->getDoctrineSchemaManager(); $column = $connection->getDoctrineColumn($blueprint->getTable(), $command->from); $tableDiff = $this->getRenamedDiff($blueprint, $command, $column, $schema); return (array) $schema->getDatabasePlatform()->getAlterTableSQL($tableDiff); }
/** * Compile a drop column command. * * @param \Illuminate\Database\Schema\Blueprint $blueprint * @param \Illuminate\Support\Fluent $command * @param \Illuminate\Database\Connection $connection * @return array */ public function compileDropColumn(Blueprint $blueprint, Fluent $command, Connection $connection) { $schema = $connection->getDoctrineSchemaManager(); $tableDiff = $this->getDoctrineTableDiff($blueprint, $schema); foreach ($command->columns as $name) { $column = $connection->getDoctrineColumn($blueprint->getTable(), $name); $tableDiff->removedColumns[$name] = $column; } return (array) $schema->getDatabasePlatform()->getAlterTableSQL($tableDiff); }
/** * Get the data type for the given column name. * * @param string $table * @param string $column * @return string */ public function getColumnType($table, $column) { $table = $this->connection->getTablePrefix() . $table; return $this->connection->getDoctrineColumn($table, $column)->getType()->getName(); }
/** * Get the data type for the given column name. * * @param string $table * @param string $column * @return string */ public function getColumnType($table, $column) { return $this->connection->getDoctrineColumn($table, $column)->getType()->getName(); }