CakeSchema Class Reference

Inheritance diagram for CakeSchema:

Object DbAclSchema i18nSchema SessionsSchema List of all members.

Public Member Functions

 __columns (&$Obj)
 __construct ($options=array())
 __values ($values)
 _build ($data)
 _compareIndexes ($new, $old)
 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 32 of file schema.php.


Constructor & Destructor Documentation

CakeSchema::__construct ( options = array()  ) 

Constructor

Parameters:
array $options optional load object properties

Definition at line 73 of file schema.php.

References __construct(), _build(), camelize(), name(), Configure::read(), and slug().


Member Function Documentation

CakeSchema::__columns ( &$  Obj  ) 

Formats Schema columns from Model Object

Parameters:
array $Obj model object
Returns:
array Formatted columns public

Definition at line 465 of file schema.php.

References $name, error(), and ConnectionManager::getDataSource().

Referenced by read().

CakeSchema::__values ( values  ) 

Formats Schema columns from Model Object

Parameters:
array $values options keys(type, null, default, key, length, extra)
Returns:
array Formatted values public

Definition at line 444 of file schema.php.

Referenced by write().

CakeSchema::_build ( data  ) 

Builds schema object properties

Parameters:
array $data loaded object properties
Returns:
void protected

Definition at line 98 of file schema.php.

References $file, name(), and underscore().

Referenced by __construct(), load(), and write().

CakeSchema::_compareIndexes ( new,
old 
)

Compare two schema indexes

Parameters:
array $new New indexes
array $old Old indexes
Returns:
mixed false on failure or array of indexes to add and drop

Definition at line 507 of file schema.php.

References $name.

Referenced by compare().

CakeSchema::after ( event = array()  ) 

After callback to be implemented in subclasses

Parameters:
array $events schema object properties public

Reimplemented in DbAclSchema, i18nSchema, and SessionsSchema.

Definition at line 134 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, and SessionsSchema.

Definition at line 125 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 373 of file schema.php.

References $tables, _compareIndexes(), and after().

CakeSchema::load ( options = array()  ) 

Reads database and creates schema tables

Parameters:
array $options schema object properties
Returns:
array Set of name and tables public

Definition at line 143 of file schema.php.

References $file, $name, $path, and _build().

CakeSchema::read ( options = array()  ) 

Reads database and creates schema tables

Options

Definition at line 179 of file schema.php.

References $connection, $tables, __columns(), classify(), config(), ConnectionManager::getDataSource(), App::import(), ClassRegistry::init(), Configure::listObjects(), name(), 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 286 of file schema.php.

References $connection, $file, $out, $path, $tables, __values(), _build(), and read().


Member Data Documentation

CakeSchema::$connection = 'default'

Definition at line 60 of file schema.php.

Referenced by read(), and write().

CakeSchema::$file = 'schema.php'

Definition at line 53 of file schema.php.

Referenced by _build(), load(), and write().

CakeSchema::$name = null

Reimplemented in DbAclSchema, i18nSchema, and SessionsSchema.

Definition at line 39 of file schema.php.

Referenced by __columns(), _compareIndexes(), and load().

CakeSchema::$path = null

Definition at line 46 of file schema.php.

Referenced by load(), and write().

CakeSchema::$tables = array()

Definition at line 67 of file schema.php.

Referenced by compare(), read(), and write().


The documentation for this class was generated from the following file:
Generated on Sun Nov 22 00:30:55 2009 for CakePHP 1.2.x.x (v1.2.4.8284) by doxygen 1.4.7