|
Doctrine 1.2.4
|
Inherits Doctrine_Configurable, and Countable.
Public Member Functions | |
| __construct ($name, Doctrine_Connection $conn, $initDefinition=false) | |
| __call ($method, $arguments) | |
| __get ($option) | |
| __isset ($option) | |
| __toString () | |
| addCheckConstraint ($definition, $name) | |
| addForeignKey (array $definition) | |
| addGenerator (Doctrine_Record_Generator $generator, $name=null) | |
| addIndex ($index, array $definition) | |
| addListener ($listener, $name=null) | |
| addNamedQuery ($queryKey, $query) | |
| addRecord (Doctrine_Record $record) | |
| addRecordListener ($listener, $name=null) | |
| addTemplate ($template, Doctrine_Template $impl) | |
| applyInheritance ($where) | |
| bind ($args, $type) | |
| bindQueryPart ($queryPart, $value) | |
| bindQueryParts (array $queryParts) | |
| clear () | |
| construct () | |
| count () | |
| create (array $array=array()) | |
| createNamedQuery ($queryKey) | |
| createQuery ($alias= '') | |
| enumIndex ($fieldName, $value) | |
| enumValue ($fieldName, $index) | |
| execute ($queryKey, $params=array(), $hydrationMode=Doctrine_Core::HYDRATE_RECORD) | |
| executeOne ($queryKey, $params=array(), $hydrationMode=Doctrine_Core::HYDRATE_RECORD) | |
| export () | |
| find () | |
| findAll ($hydrationMode=null) | |
| findBy ($fieldName, $value, $hydrationMode=null) | |
| findByDql ($dql, $params=array(), $hydrationMode=null) | |
| findBySql ($dql, $params=array(), $hydrationMode=null) | |
| findOneBy ($fieldName, $value, $hydrationMode=null) | |
| getAttribute ($attribute) | |
| getAttributes () | |
| getBoundQueryPart ($queryPart) | |
| getCharset () | |
| getClassnameToReturn () | |
| getCollate () | |
| getColumnCount () | |
| getColumnDefinition ($columnName) | |
| getColumnName ($fieldName) | |
| getColumnNames (array $fieldNames=null) | |
| getColumnOwner ($columnName) | |
| getColumns () | |
| getComponentName () | |
| getConnection () | |
| getData () | |
| getDefaultValueOf ($fieldName) | |
| getDefinitionOf ($fieldName) | |
| getEnumValues ($fieldName) | |
| getExportableFormat ($parseForeignKeys=true) | |
| getFieldLength ($fieldName) | |
| getFieldName ($columnName) | |
| getFieldNames () | |
| getFieldValidators ($fieldName) | |
| getFilters () | |
| getGenerator ($generator) | |
| getGenerators () | |
| getIdentifier () | |
| getIdentifierColumnNames () | |
| getIdentifierType () | |
| getImpl ($template) | |
| getIndex ($index) | |
| getListener () | |
| getLocator () | |
| getMethodOwner ($method) | |
| getOption ($name) | |
| getOptions () | |
| getOrderByStatement ($alias=null, $columnNames=false) | |
| getParent () | |
| getParentGenerator () | |
| getProxy ($id=null) | |
| getQueryObject () | |
| getRecord () | |
| getRecordInstance () | |
| getRecordListener () | |
| getRelation ($alias, $recursive=true) | |
| getRelationParser () | |
| getRelations () | |
| getRepository () | |
| getTableName () | |
| getTemplate ($template) | |
| getTemplates () | |
| getTree () | |
| getTypeOf ($fieldName) | |
| getTypeOfColumn ($columnName) | |
| getUniques () | |
| hasColumn ($columnName) | |
| hasDefaultValues () | |
| hasField ($fieldName) | |
| hasGenerator ($generator) | |
| hasMany () | |
| hasOne () | |
| hasRelation ($alias) | |
| hasTemplate ($template) | |
| initDefinition () | |
| initIdentifier () | |
| isGenerator () | |
| isIdentifier ($fieldName) | |
| isIdentifierAutoincrement () | |
| isIdentifierComposite () | |
| isInheritedColumn ($columnName) | |
| isTree () | |
| locate ($name) | |
| prepareValue ($fieldName, $value, $typeHint=null) | |
| processOrderBy ($alias, $orderBy, $columnNames=false) | |
| removeColumn ($fieldName) | |
| removeRecord (Doctrine_Record $record) | |
| setAttribute ($attribute, $value) | |
| setCharset ($charset) | |
| setCollate ($collate) | |
| setColumn ($name, $type=null, $length=null, $options=array(), $prepend=false) | |
| setColumnOption ($columnName, $option, $value) | |
| setColumnOptions ($columnName, array $options) | |
| setColumns (array $definitions) | |
| setConnection (Doctrine_Connection $conn) | |
| setData (array $data) | |
| setEventListener ($listener) | |
| setGenerator (Doctrine_Record_Generator $generator) | |
| setImpl ($template, $class) | |
| setListener ($listener) | |
| setLocator (Doctrine_Locator $locator) | |
| setMethodOwner ($method, $class) | |
| setOption ($name, $value) | |
| setOptions ($options) | |
| setParent (Doctrine_Configurable $component) | |
| setRecordListener ($listener) | |
| setTableName ($tableName) | |
| unique ($fields, $options=array(), $createdUniqueIndex=true) | |
| unsetAttribute ($attribute) | |
| unshiftFilter (Doctrine_Record_Filter $filter) | |
| validateField ($fieldName, $value, Doctrine_Record $record=null) | |
| validateUniques (Doctrine_Record $record) | |
Static Public Member Functions | |
| static | getNullObject () |
| static | initNullObject (Doctrine_Null $null) |
Protected Member Functions | |
| _checkForeignKeyExists ($def, $foreignKeys) | |
| _resolveFindByFieldName ($name) | |
Protected Attributes | |
| $_uniques = array() | |
| Doctrine_Table::__construct | ( | $name, | |
| Doctrine_Connection | $conn, | ||
$initDefinition = false |
|||
| ) |
the constructor
| Doctrine_Connection_Exception | if there are no opened connections |
| string | $name | the name of the component |
| Doctrine_Connection | $conn | the connection associated with this table |
| boolean | $initDefinition | whether to init the in-memory schema |
Definition at line 238 of file Table.php.
| Doctrine_Table::__call | ( | $method, | |
| $arguments | |||
| ) |
Adds support for magic finders.
This method add support for calling methods not defined in code, such as: findByColumnName, findByRelationAlias findById, findByContactId, etc.
Definition at line 2805 of file Table.php.
| Doctrine_Table::__get | ( | $option | ) |
Magic method for accessing to object properties.
This method is an alias for getOption. foreach ($table->indexes as $name => $definition) { // ... }
| string | $option |
Definition at line 773 of file Table.php.
| Doctrine_Table::__isset | ( | $option | ) |
| Doctrine_Table::__toString | ( | ) |
Generates a string representation of this object.
This method is useful for debugging purposes, or it can be overriden in Doctrine_Record to provide a value when Record is casted to (string).
|
protected |
Check if a foreign definition already exists in the fks array for a foreign table, local and foreign key
| array | $def | Foreign key definition to check for |
| array | $foreignKeys | Array of existing foreign key definitions to check in |
Definition at line 740 of file Table.php.
|
protected |
Resolves the passed find by field name inflecting the parameter.
This method resolves the appropriate field name regardless of whether the user passes a column name, field name, or a Doctrine_Inflector::classified() version of their column name. It will be inflected with Doctrine_Inflector::tableize() to get the column or field name.
| string | $name |
| Doctrine_Table::addCheckConstraint | ( | $definition, | |
| $name | |||
| ) |
Adds a check constraint to the table in-memory definition.
This method adds a CHECK constraint to the schema definition. It does not add the constraint to the physical table in the db;
| $definition | ||
| mixed | $name | if string used as name for the constraint. Otherwise it is indexed numerically. |
Definition at line 850 of file Table.php.
| Doctrine_Table::addForeignKey | ( | array | $definition | ) |
Adds a foreignKey to the table in-memory definition.
This method adds a foreign key to the schema definition. It does not add the key to the physical table in the db;
| array | $definition | definition of the foreign key |
Definition at line 833 of file Table.php.
| Doctrine_Table::addGenerator | ( | Doctrine_Record_Generator | $generator, |
$name = null |
|||
| ) |
Adds a generate to the table instance.
| Doctrine_Record_Generator | $generator | |
| string | $name |
Definition at line 2524 of file Table.php.
| Doctrine_Table::addIndex | ( | $index, | |
| array | $definition | ||
| ) |
Adds an index to this table in-memory definition.
This method adds an INDEX to the schema definition. It does not add the index to the physical table in the db;
| string | $index | index name |
| array | $definition | keys are type, fields |
Definition at line 871 of file Table.php.
|
inherited |
addListener
| Doctrine_EventListener_Interface | Doctrine_Overloadable | $listener |
Definition at line 277 of file Configurable.php.
| Doctrine_Table::addNamedQuery | ( | $queryKey, | |
| $query | |||
| ) |
Adds a named query in the query registry.
This methods register a query object with a name to use in the future.
| $queryKey | query key name to use for storage | |
| string | Doctrine_Query | $query | DQL string or object |
Definition at line 1535 of file Table.php.
| Doctrine_Table::addRecord | ( | Doctrine_Record | $record | ) |
Adds a record to the first level cache (identity map).
This method is used internally to cache records, ensuring that only one object that represents a sql record exists in all scopes.
| Doctrine_Record | $record | record to be added |
Definition at line 1769 of file Table.php.
|
inherited |
addRecordListener
| Doctrine_EventListener_Interface | Doctrine_Overloadable | $listener |
Definition at line 225 of file Configurable.php.
| Doctrine_Table::addTemplate | ( | $template, | |
| Doctrine_Template | $impl | ||
| ) |
Adds a template to this table.
| string | $template | template name |
| Doctrine_Template | $impl | behavior to attach |
Definition at line 2474 of file Table.php.
|
final |
applyInheritance
| $where | query where part to be modified |
Definition at line 1931 of file Table.php.
| Doctrine_Table::bind | ( | $args, | |
| $type | |||
| ) |
Adds a relation to the table.
This method defines a relation on this table, that will be present on every record belonging to this component.
| array | $args | first value is a string, name of related component; second value is array, options for the relation. |
| integer | $type | Doctrine_Relation::ONE or Doctrine_Relation::MANY |
Definition at line 943 of file Table.php.
| Doctrine_Table::bindQueryPart | ( | $queryPart, | |
| $value | |||
| ) |
Adds default query parts to the selects executed on this table.
This method binds given value to given query part. Every query created by this table will have this part set by default.
| string | $queryPart | |
| mixed | $value |
Definition at line 2589 of file Table.php.
| Doctrine_Table::bindQueryParts | ( | array | $queryParts | ) |
Binds query parts to this component.
| array | $queryParts | an array of pre-bound query parts |
Definition at line 2572 of file Table.php.
| Doctrine_Table::clear | ( | ) |
| Doctrine_Table::construct | ( | ) |
Construct template method.
This method provides concrete Table classes with the possibility to hook into the constructor procedure. It is called after the Doctrine_Table construction process is finished.
Definition at line 287 of file Table.php.
| Doctrine_Table::count | ( | ) |
Implements Countable interface.
| Doctrine_Table::create | ( | array | $array = array() | ) |
Creates a new record.
This method create a new instance of the model defined by this table. The class of this record is the subclass of Doctrine_Record defined by this component. The record is not created in the database until you call ().
| $array | an array where keys are field names and values representing field values. Can contain also related components; |
Definition at line 1518 of file Table.php.
| Doctrine_Table::createNamedQuery | ( | $queryKey | ) |
Creates a named query from one in the query registry.
This method clones a new query object from a previously registered one.
| string | $queryKey | query key name |
Definition at line 1550 of file Table.php.
| Doctrine_Table::createQuery | ( | $alias = '' | ) |
Creates a query on this table.
This method returns a new Doctrine_Query object and adds the component name of this table as the query 'from' part. $table = Doctrine_Core::getTable('User'); $table->createQuery('myuser') ->where('myuser.Phonenumber = ?', '5551234');
| string | $alias | name for component aliasing |
Definition at line 1028 of file Table.php.
| Doctrine_Table::enumIndex | ( | $fieldName, | |
| $value | |||
| ) |
Retrieves an enum index.
| string | $fieldName | |
| mixed | $value | value of the enum considered |
Definition at line 2013 of file Table.php.
| Doctrine_Table::enumValue | ( | $fieldName, | |
| $index | |||
| ) |
Retrieves an enum value.
This method finds a enum string value. If ATTR_USE_NATIVE_ENUM is set on the connection, index and value are the same thing.
| string | $fieldName | |
| integer | $index | numeric index of the enum |
Definition at line 1990 of file Table.php.
| Doctrine_Table::execute | ( | $queryKey, | |
$params = array(), |
|||
$hydrationMode = Doctrine_Core::HYDRATE_RECORD |
|||
| ) |
Finds result of a named query.
This method fetches data using the provided $queryKey to choose a named query in the query registry.
| string | $queryKey | the query key |
| array | $params | prepared statement params (if any) |
| int | $hydrationMode | Doctrine_Core::HYDRATE_ARRAY or Doctrine_Core::HYDRATE_RECORD |
| Doctrine_Query_Registry | if no query for given queryKey is found |
| Doctrine_Table::executeOne | ( | $queryKey, | |
$params = array(), |
|||
$hydrationMode = Doctrine_Core::HYDRATE_RECORD |
|||
| ) |
Fetches one record with a named query.
This method uses the provided $queryKey to clone and execute the associated named query in the query registry.
| string | $queryKey | the query key |
| array | $params | prepared statement params (if any) |
| int | $hydrationMode | Doctrine_Core::HYDRATE_ARRAY or Doctrine_Core::HYDRATE_RECORD |
| Doctrine_Query_Registry | if no query for given queryKey is found |
| Doctrine_Table::export | ( | ) |
Exports this table to database based on the schema definition.
This method create a physical table in the database, using the definition that comes from the component Doctrine_Record instance.
| Doctrine_Connection_Exception | if some error other than Doctrine_Core::ERR_ALREADY_EXISTS occurred during the create table operation |
Definition at line 635 of file Table.php.
| Doctrine_Table::find | ( | ) |
Finds a record by its identifier.
$table->find(11); $table->find(11, Doctrine_Core::HYDRATE_RECORD); $table->find('namedQueryForYearArchive', array(2009), Doctrine_Core::HYDRATE_ARRAY);
| mixed | $name | Database Row ID or Query Name defined previously as a NamedQuery |
| mixed | $params | This argument is the hydration mode (Doctrine_Core::HYDRATE_ARRAY or Doctrine_Core::HYDRATE_RECORD) if first param is a Database Row ID. Otherwise this argument expect an array of query params. |
| int | $hydrationMode | Optional Doctrine_Core::HYDRATE_ARRAY or Doctrine_Core::HYDRATE_RECORD if first argument is a NamedQuery |
Definition at line 1580 of file Table.php.
| Doctrine_Table::findAll | ( | $hydrationMode = null | ) |
Retrieves all the records stored in this table.
| int | $hydrationMode | Doctrine_Core::HYDRATE_ARRAY or Doctrine_Core::HYDRATE_RECORD |
| Doctrine_Table::findBy | ( | $fieldName, | |
| $value, | |||
$hydrationMode = null |
|||
| ) |
Find records basing on a field.
| string | $column | field for the WHERE clause |
| string | $value | prepared statement parameter |
| int | $hydrationMode | Doctrine_Core::HYDRATE_ARRAY or Doctrine_Core::HYDRATE_RECORD |
Definition at line 1689 of file Table.php.
| Doctrine_Table::findByDql | ( | $dql, | |
$params = array(), |
|||
$hydrationMode = null |
|||
| ) |
Finds records in this table with a given DQL where clause.
| string | $dql | DQL WHERE clause |
| array | $params | preparated statement parameters |
| int | $hydrationMode | Doctrine_Core::HYDRATE_ARRAY or Doctrine_Core::HYDRATE_RECORD |
| Doctrine_Table::findBySql | ( | $dql, | |
$params = array(), |
|||
$hydrationMode = null |
|||
| ) |
Finds records in this table with a given SQL where clause.
| string | $dql | DQL WHERE clause to use |
| array | $params | query parameters (a la PDO) |
| int | $hydrationMode | Doctrine_Core::HYDRATE_ARRAY or Doctrine_Core::HYDRATE_RECORD |
| Doctrine_Table::findOneBy | ( | $fieldName, | |
| $value, | |||
$hydrationMode = null |
|||
| ) |
Finds the first record that satisfy the clause.
| string | $column | field for the WHERE clause |
| string | $value | prepared statement parameter |
| int | $hydrationMode | Doctrine_Core::HYDRATE_ARRAY or Doctrine_Core::HYDRATE_RECORD |
Definition at line 1704 of file Table.php.
|
inherited |
returns the value of an attribute
| integer | $attribute |
Definition at line 329 of file Configurable.php.
|
inherited |
getAttributes returns all attributes as an array
Definition at line 360 of file Configurable.php.
| Doctrine_Table::getBoundQueryPart | ( | $queryPart | ) |
Retrieves a bound query part.
| string | $queryPart | field interested |
Definition at line 2660 of file Table.php.
|
inherited |
| Doctrine_Table::getClassnameToReturn | ( | ) |
Get the classname to return. Most often this is just the options['name'].
Check the subclasses option and the inheritanceMap for each subclass to see if all the maps in a subclass is met. If this is the case return that subclass name. If no subclasses match or if there are no subclasses defined return the name of the class for this tables record.
Definition at line 1880 of file Table.php.
|
inherited |
| Doctrine_Table::getColumnCount | ( | ) |
| Doctrine_Table::getColumnDefinition | ( | $columnName | ) |
| Doctrine_Table::getColumnName | ( | $fieldName | ) |
Returns a column name for a column alias.
If the actual name for the alias cannot be found this method returns the given alias.
| string | $alias | column alias |
Definition at line 1157 of file Table.php.
| Doctrine_Table::getColumnNames | ( | array | $fieldNames = null | ) |
Returns an array containing all the column names.
Definition at line 2183 of file Table.php.
| Doctrine_Table::getColumnOwner | ( | $columnName | ) |
Gets the owner of a column.
The owner of a column is the name of the component in a hierarchy that defines the column.
| string | $columnName | the column name |
Definition at line 523 of file Table.php.
| Doctrine_Table::getColumns | ( | ) |
| Doctrine_Table::getComponentName | ( | ) |
Gets the subclass of Doctrine_Record that belongs to this table.
Definition at line 2388 of file Table.php.
| Doctrine_Table::getConnection | ( | ) |
| Doctrine_Table::getData | ( | ) |
Returns internal data.
This method is used by Doctrine_Record instances when retrieving data from database.
Definition at line 2285 of file Table.php.
| Doctrine_Table::getDefaultValueOf | ( | $fieldName | ) |
Retrieves the default value (if any) for a given column.
| string | $fieldName | column name |
Definition at line 1419 of file Table.php.
| Doctrine_Table::getDefinitionOf | ( | $fieldName | ) |
Retrieves the definition of a field.
This method retrieves the definition of the column, basing of $fieldName which can be a column name or a field name (alias).
| string | $fieldName |
| Doctrine_Table::getEnumValues | ( | $fieldName | ) |
Retrieves the enum values for a given field.
| string | $fieldName |
Definition at line 1970 of file Table.php.
| Doctrine_Table::getExportableFormat | ( | $parseForeignKeys = true | ) |
Returns an exportable representation of this object.
This method produces a array representation of the table schema, where keys are tableName, columns (
| boolean | $parseForeignKeys | whether to include foreign keys definition in the options |
Definition at line 650 of file Table.php.
| Doctrine_Table::getFieldLength | ( | $fieldName | ) |
Gets the maximum length of a field. For integer fields, length is bytes occupied. For decimal fields, it is the total number of cyphers
| string | $fieldName |
| Doctrine_Table::getFieldName | ( | $columnName | ) |
Returns a column alias for a column name.
If no alias can be found the column name is returned.
| string | $columnName | column name |
Definition at line 1192 of file Table.php.
| Doctrine_Table::getFieldNames | ( | ) |
| Doctrine_Table::getFieldValidators | ( | $fieldName | ) |
Gets the names of all validators being applied on a field.
| string | $fieldName |
Definition at line 2602 of file Table.php.
| Doctrine_Table::getFilters | ( | ) |
| Doctrine_Table::getGenerator | ( | $generator | ) |
Gets generator instance for a passed name.
| string | $generator |
Definition at line 2497 of file Table.php.
| Doctrine_Table::getGenerators | ( | ) |
| Doctrine_Table::getIdentifier | ( | ) |
| Doctrine_Table::getIdentifierColumnNames | ( | ) |
Returns an array with all the identifier column names.
| Doctrine_Table::getIdentifierType | ( | ) |
|
inherited |
getImpl returns the implementation for given class
Definition at line 187 of file Configurable.php.
| Doctrine_Table::getIndex | ( | $index | ) |
Retrieves an index definition.
This method returns a given index definition:
| string | $index | index name; |
Definition at line 898 of file Table.php.
|
inherited |
getListener
Definition at line 294 of file Configurable.php.
|
inherited |
getLocator returns the locator associated with this object
if there are no locator locally associated then this method tries to fetch the current global locator
Definition at line 75 of file Injectable.php.
| Doctrine_Table::getMethodOwner | ( | $method | ) |
|
staticinherited |
getNullObject returns the null object associated with this object
Definition at line 145 of file Injectable.php.
| Doctrine_Table::getOption | ( | $name | ) |
Returns the value of a given option.
| string | $name | the name of the option |
Definition at line 1086 of file Table.php.
| Doctrine_Table::getOptions | ( | ) |
| Doctrine_Table::getOrderByStatement | ( | $alias = null, |
|
$columnNames = false |
|||
| ) |
|
inherited |
getParent returns the parent of this component
Definition at line 423 of file Configurable.php.
| Doctrine_Table::getParentGenerator | ( | ) |
Get the parent generator responsible for this table instance
Definition at line 2560 of file Table.php.
|
final |
| $id | database row id |
| Doctrine_Find_Exception |
Definition at line 1907 of file Table.php.
| Doctrine_Table::getQueryObject | ( | ) |
| Doctrine_Table::getRecord | ( | ) |
Returns a new record.
This method checks if a internal record exists in identityMap, if does not exist it creates a new one.
Definition at line 1812 of file Table.php.
| Doctrine_Table::getRecordInstance | ( | ) |
Gets the record instance for this table.
The Doctrine_Table instance always holds at least one instance of a model so that it can be reused for several things, but primarily it is first used to instantiate all the internal in memory schema definition.
Definition at line 542 of file Table.php.
|
inherited |
getListener
Definition at line 242 of file Configurable.php.
| Doctrine_Table::getRelation | ( | $alias, | |
$recursive = true |
|||
| ) |
Retrieves a relation object for this component.
| string | $alias | relation alias; |
Definition at line 999 of file Table.php.
| Doctrine_Table::getRelationParser | ( | ) |
Retrieves the relation parser associated with this table.
Definition at line 755 of file Table.php.
| Doctrine_Table::getRelations | ( | ) |
| Doctrine_Table::getRepository | ( | ) |
Gets the internal record repository.
Definition at line 1045 of file Table.php.
| Doctrine_Table::getTableName | ( | ) |
| Doctrine_Table::getTemplate | ( | $template | ) |
Retrieves a particular template by class name.
This method retrieves a behavior/template object attached to the table. For Doctrine_Template_* classes, the base name can be used.
| string | $template | name of the behavior |
| Doctrine_Table_Exception | if the given template is not set on this table |
Definition at line 2445 of file Table.php.
| Doctrine_Table::getTemplates | ( | ) |
| Doctrine_Table::getTree | ( | ) |
Gets associated tree. This method returns the associated Tree object (if any exists). Normally implemented by NestedSet behavior.
Definition at line 2368 of file Table.php.
| Doctrine_Table::getTypeOf | ( | $fieldName | ) |
Retrieves the type of a field.
| string | $fieldName |
| Doctrine_Table::getTypeOfColumn | ( | $columnName | ) |
| Doctrine_Table::getUniques | ( | ) |
| Doctrine_Table::hasColumn | ( | $columnName | ) |
| Doctrine_Table::hasDefaultValues | ( | ) |
| Doctrine_Table::hasField | ( | $fieldName | ) |
Finds out whether the table definition has a given field.
This method returns true if
| string | $fieldName |
Definition at line 1471 of file Table.php.
| Doctrine_Table::hasGenerator | ( | $generator | ) |
| Doctrine_Table::hasMany | ( | ) |
Binds One-to-Many / Many-to-Many aggregate relation
| string | $componentName | the name of the related component |
| string | $options | relation options |
| Doctrine_Table::hasOne | ( | ) |
Binds One-to-One aggregate relation
| string | $componentName | the name of the related component |
| string | $options | relation options |
| Doctrine_Table::hasRelation | ( | $alias | ) |
Tests if a relation exists.
This method queries the table definition to find out if a relation is defined for this component. Alias defined with foreignAlias are not recognized as there's only one Doctrine_Relation object on the owning side.
| string | $alias | the relation alias to search for. |
Definition at line 988 of file Table.php.
| Doctrine_Table::hasTemplate | ( | $template | ) |
Checks if the table has a given template.
| string | $template | name of template; |
Definition at line 2462 of file Table.php.
| Doctrine_Table::initDefinition | ( | ) |
Initializes the in-memory table definition.
| string | $name |
Definition at line 295 of file Table.php.
| Doctrine_Table::initIdentifier | ( | ) |
Initializes the primary key.
Called in the construction process, builds the identifier definition copying in the schema the list of the fields which constitutes the primary key.
Definition at line 412 of file Table.php.
|
staticinherited |
initNullObject initializes the null object
| Doctrine_Null | $null |
Definition at line 134 of file Injectable.php.
| Doctrine_Table::isGenerator | ( | ) |
| Doctrine_Table::isIdentifier | ( | $fieldName | ) |
Checks whether a field is in the primary key.
Checks if $fieldName is part of the table identifier, which defines the one-column or multi-column primary key.
| string | $fieldName | The field name |
Definition at line 570 of file Table.php.
| Doctrine_Table::isIdentifierAutoincrement | ( | ) |
Checks whether a field identifier is of type autoincrement.
This method checks if the primary key is a AUTOINCREMENT column or if the table uses a natural key.
| Doctrine_Table::isIdentifierComposite | ( | ) |
Checks whether a field identifier is a composite key.
| Doctrine_Table::isInheritedColumn | ( | $columnName | ) |
| Doctrine_Table::isTree | ( | ) |
|
inherited |
locate locates a resource by given name and returns it
if the resource cannot be found locally this method tries to use the global locator for finding the resource
| Doctrine_Locator_Exception | if the resource could not be found |
| string | $name | the name of the resource |
Definition at line 96 of file Injectable.php.
| Doctrine_Table::prepareValue | ( | $fieldName, | |
| $value, | |||
$typeHint = null |
|||
| ) |
Performs special data preparation.
This method returns a representation of a field data, depending on the type of the given column.
example: $field = 'name'; $value = null; $table->prepareValue($field, $value); // Doctrine_Null
| Doctrine_Table_Exception | if unserialization of array/object typed column fails or |
| Doctrine_Table_Exception | if uncompression of gzip typed column fails * |
| string | $field | the name of the field |
| string | $value | field value |
| string | $typeHint | Type hint used to pass in the type of the value to prepare if it is already known. This enables the method to skip the type determination. Used i.e. during hydration. |
Definition at line 2316 of file Table.php.
| Doctrine_Table::processOrderBy | ( | $alias, | |
| $orderBy, | |||
$columnNames = false |
|||
| ) |
Process an order by statement to be prefixed with the passed alias and field names converted to column names if the 3rd argument is true.
| string | $alias | The alias to prefix columns with |
| string | $orderBy | The order by to process |
| string | $columnNames | Whether or not to convert field names to column names |
Definition at line 1118 of file Table.php.
| Doctrine_Table::removeColumn | ( | $fieldName | ) |
Removes a field name from the table schema information.
| string | $fieldName |
Definition at line 2166 of file Table.php.
| Doctrine_Table::removeRecord | ( | Doctrine_Record | $record | ) |
Removes a record from the identity map.
This method deletes from the cache the given record; can be used to force reloading of an object from database.
| Doctrine_Record | $record | record to remove from cache |
Definition at line 1792 of file Table.php.
|
inherited |
setAttribute sets a given attribute
$manager->setAttribute(Doctrine_Core::ATTR_PORTABILITY, Doctrine_Core::PORTABILITY_ALL);
| mixed | $attribute | either a Doctrine_Core::ATTR_* integer constant or a string corresponding to a constant |
| mixed | $value | the value of the attribute |
| Doctrine_Exception | if the value is invalid |
Definition at line 73 of file Configurable.php.
|
inherited |
|
inherited |
| Doctrine_Table::setColumn | ( | $name, | |
$type = null, |
|||
$length = null, |
|||
$options = array(), |
|||
$prepend = false |
|||
| ) |
Adds a column to the schema.
This method does not alter the database table;
| string | $name | column physical name |
| string | $type | type of data |
| integer | $length | maximum length |
| mixed | $options | |
| boolean | $prepend | Whether to prepend or append the new column to the column list. By default the column gets appended. |
| Doctrine_Table_Exception | if trying use wrongly typed parameter |
Definition at line 1286 of file Table.php.
| Doctrine_Table::setColumnOption | ( | $columnName, | |
| $option, | |||
| $value | |||
| ) |
Set an individual column option
| string | $columnName | |
| string | $option | |
| string | $value |
Definition at line 1239 of file Table.php.
| Doctrine_Table::setColumnOptions | ( | $columnName, | |
| array | $options | ||
| ) |
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
));
}
| string | $columnName | |
| array | $validators |
Definition at line 1218 of file Table.php.
| Doctrine_Table::setColumns | ( | array | $definitions | ) |
| Doctrine_Table::setConnection | ( | Doctrine_Connection | $conn | ) |
Sets the default connection for this table.
This method assign the connection which this table will use to create queries.
Doctrine_Connection a connection object
| Doctrine_Table::setData | ( | array | $data | ) |
|
inherited |
| Doctrine_EventListener | $listener |
Definition at line 214 of file Configurable.php.
| Doctrine_Table::setGenerator | ( | Doctrine_Record_Generator | $generator | ) |
Set the generator responsible for creating this table
| Doctrine_Record_Generator | $generator |
Definition at line 2540 of file Table.php.
|
inherited |
setImpl binds given class to given template name
this method is the base of Doctrine dependency injection
| string | $template | name of the class template |
| string | $class | name of the class to be bound |
Definition at line 174 of file Configurable.php.
|
inherited |
setListener
| Doctrine_EventListener_Interface | Doctrine_Overloadable | $listener |
Definition at line 311 of file Configurable.php.
|
inherited |
setLocator this method can be used for setting the locator object locally
| Doctrine_Locator | the locator object |
Definition at line 60 of file Injectable.php.
| Doctrine_Table::setMethodOwner | ( | $method, | |
| $class | |||
| ) |
| Doctrine_Table::setOption | ( | $name, | |
| $value | |||
| ) |
Sets an option for the table.
This method sets an option and returns this object in order to allow flexible method chaining.
| string | $name | the name of the option to set |
| mixed | $value | the value of the option |
Definition at line 1061 of file Table.php.
| Doctrine_Table::setOptions | ( | $options | ) |
Sets all the options.
This method sets options of the table that are specified in the argument. It has no effect on other options.
| array | $options | keys are option names |
|
inherited |
sets a parent for this configurable component the parent must be configurable component itself
| Doctrine_Configurable | $component |
Definition at line 412 of file Configurable.php.
|
inherited |
setListener
| Doctrine_EventListener_Interface | Doctrine_Overloadable | $listener |
Definition at line 259 of file Configurable.php.
| Doctrine_Table::setTableName | ( | $tableName | ) |
| Doctrine_Table::unique | ( | $fields, | |
$options = array(), |
|||
$createdUniqueIndex = true |
|||
| ) |
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
| array | $fields | values are fieldnames |
| array | $options | array of options for unique validator |
| bool | $createUniqueIndex | Whether or not to create a unique index in the database |
Definition at line 919 of file Table.php.
|
inherited |
Unset an attribute from this levels attributes
| integer | $attribute |
Definition at line 347 of file Configurable.php.
| Doctrine_Table::unshiftFilter | ( | Doctrine_Record_Filter | $filter | ) |
unshiftFilter
| Doctrine_Record_Filter | $filter |
Definition at line 2675 of file Table.php.
| Doctrine_Table::validateField | ( | $fieldName, | |
| $value, | |||
| Doctrine_Record | $record = null |
||
| ) |
Validates a given field using table ATTR_VALIDATE rules.
| string | $fieldName | |
| string | $value | |
| Doctrine_Record | $record | record to consider; if it does not exists, it is created |
Definition at line 2032 of file Table.php.
| Doctrine_Table::validateUniques | ( | Doctrine_Record | $record | ) |
Validates all the unique indexes.
This methods validates 'unique' sets of fields for the given Doctrine_Record instance. Pushes error to the record error stack if they are generated.
| Doctrine_Record | $record |
Definition at line 2117 of file Table.php.
|
protected |