getDoctrineColumn() public method

Get a Doctrine Schema Column instance.
public getDoctrineColumn ( string $table, string $column ) : Doctrine\DBAL\Schema\Column
$table string
$column string
return Doctrine\DBAL\Schema\Column
Ejemplo n.º 1
0
 /**
  * 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);
 }
Ejemplo n.º 3
0
 /**
  * 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();
 }
Ejemplo n.º 4
0
 /**
  * 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();
 }