ICanBoogie
  • Documentation
  • API Reference
  • Updater master
Namespaces
  • ICanBoogie
    • Updater
Classes
  • ModelUpdater
  • ModelUpdaterList
  • ModuleUpdater
  • Update
  • UpdateCollection
  • UpdateDescriptor
  • Updater
Exceptions
  • AssertionFailed

Class ModelUpdater

Namespace: ICanBoogie\Updater
Located at ModelUpdater.php

Methods summary

public __construct( ICanBoogie\ActiveRecord\Model $model )
public __call( $method, $arguments )
public __get( $property )
protected get_columns( void )
protected revoke_schema( void )
public has_column( string $column_name ) : boolean

Checks if the model has the specified column.

Checks if the model has the specified column.

Parameters

$column_name

Returns

boolean
true if the specified column exists, false otherwise.
public column_has_size( string $column_name, string $size ) : boolean

Checks if the specified column has the specified size.

Checks if the specified column has the specified size.

Parameters

$column_name
The name of the column.
$size
The expected size of the column.

Returns

boolean
true if the specified column has the specified size, false otherwise.

Throws

InvalidArgumentException
If the column doesn't exists.
Exception
If the size of the column could not de retrieved.
public alter_column( string $column_name, array $changes = null )

Alters a column.

Alters a column.

Parameters

$column_name
$changes

The changes to apply to the column. If the changes are empty, the schema definition is used instead.

public rename_column( string $column_name, string $new_column_name )

Renames a column in a table.

Renames a column in a table.

Parameters

$column_name
The name of the column to rename.
$new_column_name
The new name of the column.
public create_column( $column_name, array $options = array() )
public remove_column( string $column_name )

Removes a column from the table.

Removes a column from the table.

Parameters

$column_name
The name of the column to remove.
protected resolve_column_position( $column_name, ICanBoogie\ActiveRecord\Schema $schema )
public create_unique_index( $index_name, $column_name = null )

Magic methods summary

public assert_has_column( string $column_name ) : ICanBoogie\Updater\ModelUpdater

Asserts that a model has a column with the specified name.

Asserts that a model has a column with the specified name.

Parameters

$column_name

Returns

ICanBoogie\Updater\ModelUpdater
public assert_not_has_column( string $column_name ) : ICanBoogie\Updater\ModelUpdater

Asserts that a model does not have a column with the specified name.

Asserts that a model does not have a column with the specified name.

Parameters

$column_name

Returns

ICanBoogie\Updater\ModelUpdater
public assert_column_has_size( string $column_name, $size ) : ICanBoogie\Updater\ModelUpdater

Asserts a column has a given size.

Asserts a column has a given size.

Parameters

$column_name
$size

Returns

ICanBoogie\Updater\ModelUpdater
public assert_not_column_has_size( string $column_name, $size ) : ICanBoogie\Updater\ModelUpdater

Asserts a column does not have a given size.

Asserts a column does not have a given size.

Parameters

$column_name
$size

Returns

ICanBoogie\Updater\ModelUpdater
public model( string $statement, array $args = [] ) : mixed

Parameters

$statement
$args

Returns

mixed

Properties summary

protected $model : ICanBoogie\ActiveRecord\Model

		

Magic properties

public read-only $columns : array
public read-only $schema : ICanBoogie\ActiveRecord\Schema
Updater master – Check on GitHub – API documentation generated by ApiGen