CakeSchema Class Reference

Public Member Functions | |
| _build ($data) | |
| after ($event=array()) | |
| before ($event=array()) | |
| compare ($old, $new=null) | |
| load ($options=array()) | |
| read ($options=array()) | |
| write ($object, $options=array()) | |
Public Attributes | |
| $connection = 'default' | |
| $file = 'schema.php' | |
| $name = null | |
| $path = null | |
| $tables = array() | |
Detailed Description
Definition at line 34 of file schema.php.
Member Function Documentation
| CakeSchema::_build | ( | $ | data | ) |
Builds schema object properties
- Parameters:
-
array $data loaded object properties protected
Definition at line 99 of file schema.php.
References $file, and Inflector::underscore().
| CakeSchema::after | ( | $ | event = array() |
) |
After callback to be implemented in subclasses
- Parameters:
-
array $events schema object properties public
Reimplemented in DbAclSchema, i18nSchema, SessionsSchema, DbAclSchema, i18nSchema, and SessionsSchema.
Definition at line 135 of file schema.php.
Referenced by compare().
| CakeSchema::before | ( | $ | event = array() |
) |
Before callback to be implemented in subclasses
- Parameters:
-
array $events schema object properties
- Returns:
- boolean Should process continue public
Reimplemented in DbAclSchema, i18nSchema, SessionsSchema, DbAclSchema, i18nSchema, and SessionsSchema.
Definition at line 126 of file schema.php.
| CakeSchema::compare | ( | $ | old, | |
| $ | new = null | |||
| ) |
Compares two sets of schemas
- Parameters:
-
mixed $old Schema object or array mixed $new Schema object or array
- Returns:
- array Tables (that are added, dropped, or changed) public
Definition at line 358 of file schema.php.
| CakeSchema::load | ( | $ | options = array() |
) |
| CakeSchema::read | ( | $ | options = array() |
) |
Reads database and creates schema tables
- Parameters:
-
array $options schema object properties
- Returns:
- array Array indexed by name and tables public
Definition at line 175 of file schema.php.
References $connection, $tables, Inflector::classify(), config(), ConnectionManager::getDataSource(), App::import(), ClassRegistry::init(), Configure::listObjects(), and Configure::read().
Referenced by write().
| CakeSchema::write | ( | $ | object, | |
| $ | options = array() | |||
| ) |
Writes schema file from object or options
- Parameters:
-
mixed $object schema object or options array array $options schema object properties to override object
- Returns:
- mixed false or string written to file public
Definition at line 271 of file schema.php.
References $connection, $file, $name, $out, $path, $tables, _build(), and read().
Member Data Documentation
| CakeSchema::$connection = 'default' |
| CakeSchema::$file = 'schema.php' |
| CakeSchema::$name = null |
Reimplemented in DbAclSchema, i18nSchema, and SessionsSchema.
Definition at line 41 of file schema.php.
| CakeSchema::$path = null |
| CakeSchema::$tables = array() |
The documentation for this class was generated from the following file:
- 1.2.x.x/cake/libs/model/schema.php