Doctrine


Doctrine\Doctrine_Record_Abstract
/Doctrine/Record/Abstract.php at line 33

Class Doctrine_Record_Abstract

Class:Doctrine_Record_Abstract - Superclass: Doctrine_Access
Class:Doctrine_Access - Superclass: Doctrine_Locator_Injectable
Doctrine_Locator_Injectable
⌊ Doctrine_Access
⌊ Doctrine_Record_Abstract

public abstract class Doctrine_Record_Abstract
extends Doctrine_Access

Doctrine_Record_Abstract

Package:
Doctrine
Subpackage:
Record
Author:
Konsta Vesterinen
License:
http://www.opensource.org/licenses/lgpl-license.php LGPL
See Also:
www.doctrine-project.org
Since:
1.0
Version:
$Revision$
Category:
Locator

Field Summary
protected mixed

$_table

.

Method Summary
Doctrine_Record

actAs(mixed tpl, array options)

Loads the given plugin.

Doctrine_Record

addListener(Doctrine_EventListener_Interface|Doctrine_Overloadable listener, mixed name)

addListener.

mixed

attribute(mixed attr, mixed value)

attribute sets or retrieves an option.

Doctrine_Record

bindQueryParts(array queryParts)

bindQueryParts binds query parts to given component.

Doctrine_Record

check(mixed constraint, string name)

Adds a check constraint.

Doctrine_EventListener_Interface|Doctrine_Overloadable

getListener()

getListener.

Doctrine_Table

getTable()

getTable returns the associated table object.

void

hasColumn(string name, string type, integer length, mixed options)

Sets a column definition.

void

hasColumns(array definitions)

Set multiple column definitions at once.

Doctrine_Record

hasMany(string componentName, string options)

Binds One-to-Many / Many-to-Many aggregate relation.

Doctrine_Record

hasOne(string componentName, string options)

Binds One-to-One aggregate relation.

mixed

index(string name, array definition)

index defines or retrieves an index if the second parameter is set this method defines an index if not this method retrieves index named $name.

void

loadGenerator(mixed generator)

mixed

option(mixed name, mixed value)

option sets or retrieves an option.

void

setAttribute(mixed attr, mixed value)

void

setColumnOption(string columnName, string option, string value)

Set an individual column option.

void

setColumnOptions(mixed name, mixed options, string columnName, array validators)

Customize the array of options for a column or multiple columns.

void

setInheritanceMap(mixed map)

Doctrine_Record

setListener(Doctrine_EventListener_Interface|Doctrine_Overloadable listener)

setListener.

void

setSubclasses(mixed map)

void

setTableDefinition()

void

setTableName(mixed tableName)

void

setUp()

void

unique(array fields, array options, bool createUniqueIndex)

Defines a n-uple of fields that must be unique for every record.

Methods inherited from Doctrine\Doctrine_Access
add, contains, get, offsetExists, offsetGet, offsetSet, offsetUnset, remove, set, setArray
Methods inherited from Doctrine\Doctrine_Locator_Injectable
bind, getLocator, getNullObject, initNullObject, locate, setLocator

Field Detail

/Doctrine/Record/Abstract.php at line 38

_table

protected mixed $_table


Method Detail

/Doctrine/Record/Abstract.php at line 349

actAs

public Doctrine_Record actAs(mixed tpl, array options)

Loads the given plugin.

This method loads a behavior in the record. It will add the behavior also to the record table if it. It is tipically called in @see setUp().

Parameters:
tpl - if an object, must be a subclass of Doctrine_Template. If a string, Doctrine will try to instantiate an object of the classes Doctrine_Template_$tpl and subsequently $tpl, using also autoloading capabilities if defined.
options - argument to pass to the template constructor if $tpl is a class name
Throws:
if $tpl is neither an instance of Doctrine_Template subclass or a valid class name, that could be instantiated.
Returns:
this object; provides a fluent interface.

/Doctrine/Record/Abstract.php at line 67

addListener

public Doctrine_Record addListener(Doctrine_EventListener_Interface|Doctrine_Overloadable listener, mixed name)

addListener


/Doctrine/Record/Abstract.php at line 182

attribute

public mixed attribute(mixed attr, mixed value)

attribute sets or retrieves an option

See Also:
constants availible attributes

/Doctrine/Record/Abstract.php at line 322

bindQueryParts

public Doctrine_Record bindQueryParts(array queryParts)

bindQueryParts binds query parts to given component

Parameters:
queryParts - an array of pre-bound query parts
Returns:
this object

/Doctrine/Record/Abstract.php at line 388

check

public Doctrine_Record check(mixed constraint, string name)

Adds a check constraint.

This method will add a CHECK constraint to the record table.

Parameters:
constraint - either a SQL constraint portion or an array of CHECK constraints. If array, all values will be added as constraint
name - optional constraint name. Not used if $constraint is an array.
Returns:
this object

/Doctrine/Record/Abstract.php at line 79

getListener

public Doctrine_EventListener_Interface|Doctrine_Overloadable getListener()

getListener


/Doctrine/Record/Abstract.php at line 56

getTable

public Doctrine_Table getTable()

getTable returns the associated table object

Returns:
the associated table object

/Doctrine/Record/Abstract.php at line 260

hasColumn

public void hasColumn(string name, string type, integer length, mixed options)

Sets a column definition


/Doctrine/Record/Abstract.php at line 271

hasColumns

public void hasColumns(array definitions)

Set multiple column definitions at once


/Doctrine/Record/Abstract.php at line 244

hasMany

public Doctrine_Record hasMany(string componentName, string options)

Binds One-to-Many / Many-to-Many aggregate relation

Parameters:
componentName - the name of the related component
options - relation options
See Also:
Doctrine_Relation::_$definition
Returns:
this object

/Doctrine/Record/Abstract.php at line 229

hasOne

public Doctrine_Record hasOne(string componentName, string options)

Binds One-to-One aggregate relation

Parameters:
componentName - the name of the related component
options - relation options
See Also:
Doctrine_Relation::_$definition
Returns:
this object

/Doctrine/Record/Abstract.php at line 107

index

public mixed index(string name, array definition)

index defines or retrieves an index if the second parameter is set this method defines an index if not this method retrieves index named $name

Parameters:
name - the name of the index
definition - the definition array

/Doctrine/Record/Abstract.php at line 329

loadGenerator

public void loadGenerator(mixed generator)

/Doctrine/Record/Abstract.php at line 206

option

public mixed option(mixed name, mixed value)

option sets or retrieves an option

See Also:
availible options
Parameters:
name - the name of the option
value - options value

/Doctrine/Record/Abstract.php at line 133

setAttribute

public void setAttribute(mixed attr, mixed value)

/Doctrine/Record/Abstract.php at line 310

setColumnOption

public void setColumnOption(string columnName, string option, string value)

Set an individual column option


/Doctrine/Record/Abstract.php at line 297

setColumnOptions

public void setColumnOptions(mixed name, mixed options, string columnName, array validators)

Customize the array of options for a column or multiple columns. First argument can be a single field/column name or an array of them. The second argument is an array of options.

[php] public function setTableDefinition() { parent::setTableDefinition(); $this->setColumnOptions('username', array( 'unique' => true )); }


/Doctrine/Record/Abstract.php at line 143

setInheritanceMap

public void setInheritanceMap(mixed map)

/Doctrine/Record/Abstract.php at line 90

setListener

public Doctrine_Record setListener(Doctrine_EventListener_Interface|Doctrine_Overloadable listener)

setListener


/Doctrine/Record/Abstract.php at line 148

setSubclasses

public void setSubclasses(mixed map)

/Doctrine/Record/Abstract.php at line 40

setTableDefinition

public void setTableDefinition()

/Doctrine/Record/Abstract.php at line 138

setTableName

public void setTableName(mixed tableName)

/Doctrine/Record/Abstract.php at line 45

setUp

public void setUp()

/Doctrine/Record/Abstract.php at line 128

unique

public void unique(array fields, array options, bool createUniqueIndex)

Defines a n-uple of fields that must be unique for every record.

This method Will automatically add UNIQUE index definition and validate the values on save. The UNIQUE index is not created in the database until you use @see export().

Parameters:
fields - values are fieldnames
options - array of options for unique validator
createUniqueIndex - Whether or not to create a unique index in the database

Doctrine