Inherits Doctrine_Template.
|
| | __construct (array $options=array()) |
| |
| | __get ($name) |
| |
| | __isset ($name) |
| |
| | __set ($name, $value) |
| |
| | __unset ($name) |
| |
| | actAs ($tpl, array $options=array()) |
| |
| | add ($value) |
| |
| | addChild (Doctrine_Template $template) |
| |
| | addListener ($listener, $name=null) |
| |
| | attribute ($attr, $value) |
| |
| | batchUpdateIndex ($limit=null, $offset=null, $encoding=null) |
| |
| | batchUpdateIndexTableProxy ($limit=null, $offset=null, $encoding=null) |
| |
| | bind ($name, $resource) |
| |
| | bindQueryParts (array $queryParts) |
| |
| | check ($constraint, $name=null) |
| |
| | contains ($offset) |
| |
| | get ($name) |
| |
| | getInvoker () |
| |
| | getListener () |
| |
| | getLocator () |
| |
| | getOption ($name, $default=null) |
| |
| | getOptions () |
| |
| | getPlugin () |
| |
| | getTable () |
| |
| | hasColumn ($name, $type=null, $length=null, $options=array()) |
| |
| | hasColumns (array $definitions) |
| |
| | hasMany () |
| |
| | hasOne () |
| |
| | hasPlugin () |
| |
| | index ($name, array $definition=array()) |
| |
| | locate ($name) |
| |
| | offsetExists ($offset) |
| |
| | offsetGet ($offset) |
| |
| | offsetSet ($offset, $value) |
| |
| | offsetUnset ($offset) |
| |
| | option ($name, $value=null) |
| |
| | remove ($offset) |
| |
| | searchTableProxy ($string, $query=null) |
| |
| | set ($name, $value) |
| |
| | setArray (array $array) |
| |
| | setColumnOption ($columnName, $option, $value) |
| |
| | setColumnOptions ($name, array $options) |
| |
| | setInvoker (Doctrine_Record_Abstract $invoker) |
| |
| | setListener ($listener) |
| |
| | setLocator (Doctrine_Locator $locator) |
| |
| | setTableDefinition () |
| |
| | setUp () |
| |
| | unique ($fields, $options=array(), $createUniqueIndex=true) |
| |
Definition at line 33 of file Searchable.php.
| Doctrine_Template_Searchable::__construct |
( |
array |
$options = array() | ) |
|
__construct
- Parameters
-
- Returns
- void
Definition at line 41 of file Searchable.php.
{
parent::__construct($options);
}
| Doctrine_Access::__get |
( |
|
$name | ) |
|
|
inherited |
Get key from data
- See Also
- get, offsetGet
- Parameters
-
- Returns
- mixed
Definition at line 70 of file Access.php.
{
return $this->get($name);
}
| Doctrine_Access::__isset |
( |
|
$name | ) |
|
|
inherited |
Check if key exists in data
- Parameters
-
- Returns
- boolean whether or not this object contains $name
Definition at line 81 of file Access.php.
| Doctrine_Access::__set |
( |
|
$name, |
|
|
|
$value |
|
) |
| |
|
inherited |
Set key and value to data
- See Also
- set, offsetSet
- Parameters
-
- Returns
- void
Definition at line 58 of file Access.php.
{
$this->set($name, $value);
}
| Doctrine_Access::__unset |
( |
|
$name | ) |
|
|
inherited |
Remove key from data
- Parameters
-
- Returns
- void
Definition at line 92 of file Access.php.
{
return $this->remove($name);
}
| Doctrine_Record_Abstract::actAs |
( |
|
$tpl, |
|
|
array |
$options = array() |
|
) |
| |
|
inherited |
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 Also
- setUp().
- Parameters
-
| mixed | $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. |
| array | $options | argument to pass to the template constructor if $tpl is a class name |
- Exceptions
-
- Returns
- Doctrine_Record this object; provides a fluent interface.
Definition at line 349 of file Abstract.php.
{
if ( ! is_object($tpl)) {
$className = 'Doctrine_Template_' . $tpl;
if (class_exists($className, true)) {
$tpl = new $className($options);
} else if (class_exists($tpl, true)) {
$tpl = new $tpl($options);
} else {
}
}
}
$className = get_class($tpl);
$this->_table->addTemplate($className, $tpl);
$tpl->setInvoker($this);
$tpl->setTable($this->_table);
$tpl->setUp();
$tpl->setTableDefinition();
return $this;
}
| Doctrine_Access::add |
( |
|
$value | ) |
|
|
inherited |
Add the value
- Parameters
-
| mixed | $value | The value to add |
- Returns
- void
Definition at line 199 of file Access.php.
Adds a plugin as a child to this plugin
- Parameters
-
- Returns
- Doctrine_Template. Chainable.
Definition at line 109 of file Template.php.
{
$this->_plugin->addChild($template);
return $this;
}
| Doctrine_Record_Abstract::addListener |
( |
|
$listener, |
|
|
|
$name = null |
|
) |
| |
|
inherited |
addListener
- Parameters
-
- Returns
- Doctrine_Record
Definition at line 67 of file Abstract.php.
{
$this->_table->addRecordListener($listener, $name);
return $this;
}
| Doctrine_Record_Abstract::attribute |
( |
|
$attr, |
|
|
|
$value |
|
) |
| |
|
inherited |
attribute sets or retrieves an option
- See Also
- Doctrine_Core::ATTR_* constants availible attributes
- Parameters
-
- Returns
- mixed
Definition at line 182 of file Abstract.php.
{
if ($value == null) {
if (is_array($attr)) {
foreach ($attr as $k => $v) {
$this->_table->setAttribute($k, $v);
}
} else {
return $this->_table->getAttribute($attr);
}
} else {
$this->_table->setAttribute($attr, $value);
}
}
| Doctrine_Template_Searchable::batchUpdateIndex |
( |
|
$limit = null, |
|
|
|
$offset = null, |
|
|
|
$encoding = null |
|
) |
| |
Make the batchUpdateIndex() function available to the template so Doctrine_Record child classes with the behavior enabled can all the function
- Parameters
-
| integer | $limit | |
| integer | $offset | |
- Returns
- void
Definition at line 67 of file Searchable.php.
{
$this->_plugin->batchUpdateIndex($limit, $offset, $encoding);
}
| Doctrine_Template_Searchable::batchUpdateIndexTableProxy |
( |
|
$limit = null, |
|
|
|
$offset = null, |
|
|
|
$encoding = null |
|
) |
| |
Proxy method so the batch updating can be called from table classes
- Parameters
-
| integer | $limit | |
| integer | $offset | |
- Returns
- void
Definition at line 79 of file Searchable.php.
| Doctrine_Locator_Injectable::bind |
( |
|
$name, |
|
|
|
$resource |
|
) |
| |
|
inherited |
bind binds a resource to a name
- Parameters
-
| string | $name | the name of the resource to bind |
| mixed | $value | the value of the resource |
- Returns
- Doctrine_Locator this object
Definition at line 120 of file Injectable.php.
{
$this->_resources[$name] = $resource;
return $this;
}
| Doctrine_Record_Abstract::bindQueryParts |
( |
array |
$queryParts | ) |
|
|
inherited |
bindQueryParts binds query parts to given component
- Parameters
-
| array | $queryParts | an array of pre-bound query parts |
- Returns
- Doctrine_Record this object
Definition at line 322 of file Abstract.php.
{
$this->_table->bindQueryParts($queryParts);
return $this;
}
| Doctrine_Record_Abstract::check |
( |
|
$constraint, |
|
|
|
$name = null |
|
) |
| |
|
inherited |
Adds a check constraint.
This method will add a CHECK constraint to the record table.
- Parameters
-
| mixed | $constraint | either a SQL constraint portion or an array of CHECK constraints. If array, all values will be added as constraint |
| string | $name | optional constraint name. Not used if $constraint is an array. |
- Returns
- Doctrine_Record this object
Definition at line 388 of file Abstract.php.
{
if (is_array($constraint)) {
foreach ($constraint as $name => $def) {
$this->_table->addCheckConstraint($def, $name);
}
} else {
$this->_table->addCheckConstraint($constraint, $name);
}
return $this;
}
| Doctrine_Access::contains |
( |
|
$offset | ) |
|
|
inherited |
Check if the specified offset exists
- Parameters
-
| mixed | $offset | The offset to check |
- Returns
- boolean True if exists otherwise false
Definition at line 188 of file Access.php.
| Doctrine_Template::get |
( |
|
$name | ) |
|
|
inherited |
| Doctrine_Template::getInvoker |
( |
| ) |
|
|
inherited |
returns the last used invoker
- Returns
- Doctrine_Record the record that invoked the last delegated call
Definition at line 98 of file Template.php.
{
return $this->_invoker;
}
| Doctrine_Record_Abstract::getListener |
( |
| ) |
|
|
inherited |
getListener
- Returns
- Doctrine_EventListener_Interface|Doctrine_Overloadable
Definition at line 79 of file Abstract.php.
{
return $this->_table->getRecordListener();
}
| Doctrine_Locator_Injectable::getLocator |
( |
| ) |
|
|
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
- Returns
- Doctrine_Locator
Definition at line 75 of file Injectable.php.
{
if ( ! isset($this->_locator)) {
}
return $this->_locator;
}
| static Doctrine_Locator_Injectable::getNullObject |
( |
| ) |
|
|
staticinherited |
| Doctrine_Template::getOption |
( |
|
$name, |
|
|
|
$default = null |
|
) |
| |
|
inherited |
getOption returns the value of given option
- Parameters
-
| string | $name | the name of the option |
| mixed | $default | default value if option is not found |
- Returns
- mixed the value of given option
Definition at line 155 of file Template.php.
{
if (isset($this->_options[$name])) {
return $this->_options[$name];
}
return $default;
}
| Doctrine_Template::getOptions |
( |
| ) |
|
|
inherited |
getOptions returns all options of this template and the associated values
- Returns
- array all options and their values
Definition at line 142 of file Template.php.
{
return $this->_options;
}
| Doctrine_Template::getPlugin |
( |
| ) |
|
|
inherited |
Get plugin instance
- Returns
- void
Definition at line 121 of file Template.php.
{
return $this->_plugin;
}
| Doctrine_Template::getTable |
( |
| ) |
|
|
inherited |
| Doctrine_Record_Abstract::hasColumn |
( |
|
$name, |
|
|
|
$type = null, |
|
|
|
$length = null, |
|
|
|
$options = array() |
|
) |
| |
|
inherited |
Sets a column definition
- Parameters
-
| string | $name | |
| string | $type | |
| integer | $length | |
| mixed | $options | |
- Returns
- void
Definition at line 260 of file Abstract.php.
{
$this->_table->setColumn($name, $type, $length, $options);
}
| Doctrine_Record_Abstract::hasColumns |
( |
array |
$definitions | ) |
|
|
inherited |
Set multiple column definitions at once
- Parameters
-
- Returns
- void
Definition at line 271 of file Abstract.php.
{
foreach ($definitions as $name => $options) {
$length = isset($options['length']) ? $options['length']:null;
$this->
hasColumn($name, $options[
'type'], $length, $options);
}
}
| Doctrine_Record_Abstract::hasMany |
( |
| ) |
|
|
inherited |
Binds One-to-Many / Many-to-Many aggregate relation
- Parameters
-
| string | $componentName | the name of the related component |
| string | $options | relation options |
- See Also
- Doctrine_Relation::_$definition
- Returns
- Doctrine_Record this object
Definition at line 244 of file Abstract.php.
| Doctrine_Record_Abstract::hasOne |
( |
| ) |
|
|
inherited |
Binds One-to-One aggregate relation
- Parameters
-
| string | $componentName | the name of the related component |
| string | $options | relation options |
- See Also
- Doctrine_Relation::_$definition
- Returns
- Doctrine_Record this object
Definition at line 229 of file Abstract.php.
| Doctrine_Template::hasPlugin |
( |
| ) |
|
|
inherited |
Check if this template has a generator plugin
- Returns
- boolean
Definition at line 131 of file Template.php.
{
return isset($this->_plugin) ? true : false;
}
| Doctrine_Record_Abstract::index |
( |
|
$name, |
|
|
array |
$definition = array() |
|
) |
| |
|
inherited |
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
-
| string | $name | the name of the index |
| array | $definition | the definition array |
- Returns
- mixed
Definition at line 107 of file Abstract.php.
{
if ( ! $definition) {
return $this->_table->getIndex($name);
} else {
return $this->_table->addIndex($name, $definition);
}
}
| static Doctrine_Locator_Injectable::initNullObject |
( |
Doctrine_Null |
$null | ) |
|
|
staticinherited |
initNullObject initializes the null object
- Parameters
-
- Returns
- void
Definition at line 134 of file Injectable.php.
{
self::$_null = $null;
}
| Doctrine_Locator_Injectable::locate |
( |
|
$name | ) |
|
|
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
- See Also
- Doctrine_Locator::locate()
- Exceptions
-
- Parameters
-
| string | $name | the name of the resource |
- Returns
- mixed the located resource
Definition at line 96 of file Injectable.php.
{
if (isset($this->_resources[$name])) {
if (is_object($this->_resources[$name])) {
return $this->_resources[$name];
} else {
$concreteImpl = $this->_resources[$name];
return $this->
getLocator()->locate($concreteImpl);
}
} else {
}
}
| Doctrine_Access::offsetExists |
( |
|
$offset | ) |
|
|
inherited |
Check if an offset axists
- Parameters
-
- Returns
- boolean Whether or not this object contains $offset
Definition at line 103 of file Access.php.
| Doctrine_Access::offsetGet |
( |
|
$offset | ) |
|
|
inherited |
An alias of get()
- See Also
- get, __get
- Parameters
-
- Returns
- mixed
Definition at line 115 of file Access.php.
{
return $this->get($offset);
}
| Doctrine_Access::offsetSet |
( |
|
$offset, |
|
|
|
$value |
|
) |
| |
|
inherited |
Sets $offset to $value
- See Also
- set, __set
- Parameters
-
- Returns
- void
Definition at line 128 of file Access.php.
{
if ( ! isset($offset)) {
} else {
$this->set($offset, $value);
}
}
| Doctrine_Access::offsetUnset |
( |
|
$offset | ) |
|
|
inherited |
| Doctrine_Record_Abstract::option |
( |
|
$name, |
|
|
|
$value = null |
|
) |
| |
|
inherited |
option sets or retrieves an option
- See Also
- Doctrine_Table::$options availible options
- Parameters
-
| mixed | $name | the name of the option |
| mixed | $value | options value |
- Returns
- mixed
Definition at line 206 of file Abstract.php.
{
if ($value === null) {
if (is_array($name)) {
foreach ($name as $k => $v) {
$this->_table->setOption($k, $v);
}
} else {
return $this->_table->getOption($name);
}
} else {
$this->_table->setOption($name, $value);
}
}
| Doctrine_Access::remove |
( |
|
$offset | ) |
|
|
inherited |
Remove the element with the specified offset
- Parameters
-
| mixed | $offset | The offset to remove |
- Returns
- boolean True if removed otherwise false
Definition at line 154 of file Access.php.
| Doctrine_Template_Searchable::searchTableProxy |
( |
|
$string, |
|
|
|
$query = null |
|
) |
| |
Searchable keyword search proxy for Doctrine_Table
- Parameters
-
| string | $string | Keyword string to search for |
| Doctrine_Query | $query | Query object to alter. Adds where condition to limit the results using the search index |
- Returns
- array ids and relevancy
Definition at line 91 of file Searchable.php.
{
return $this->_plugin->search($string, $query);
}
| Doctrine_Template::set |
( |
|
$name, |
|
|
|
$value |
|
) |
| |
|
inherited |
| Doctrine_Access::setArray |
( |
array |
$array | ) |
|
|
inherited |
Set an entire aray to the data
- Parameters
-
| array | $array | An array of key => value pairs |
- Returns
- Doctrine_Access
Definition at line 41 of file Access.php.
{
foreach ($array as $k => $v) {
$this->set($k, $v);
}
return $this;
}
| Doctrine_Record_Abstract::setColumnOption |
( |
|
$columnName, |
|
|
|
$option, |
|
|
|
$value |
|
) |
| |
|
inherited |
Set an individual column option
- Parameters
-
| string | $columnName | |
| string | $option | |
| string | $value | |
- Returns
- void
Definition at line 310 of file Abstract.php.
{
$this->_table->setColumnOption($columnName, $option, $value);
}
| Doctrine_Record_Abstract::setColumnOptions |
( |
|
$name, |
|
|
array |
$options |
|
) |
| |
|
inherited |
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
));
}
- Parameters
-
| string | $columnName | |
| array | $validators | |
- Returns
- void
Definition at line 297 of file Abstract.php.
{
$this->_table->setColumnOptions($name, $options);
}
| Doctrine_Record_Abstract::setListener |
( |
|
$listener | ) |
|
|
inherited |
setListener
- Parameters
-
- Returns
- Doctrine_Record
Definition at line 90 of file Abstract.php.
{
$this->_table->setRecordListener($listener);
return $this;
}
setLocator this method can be used for setting the locator object locally
- Parameters
-
- Returns
- Doctrine_Locator_Injectable this instance
Definition at line 60 of file Injectable.php.
{
$this->_locator = $locator;
return $this;
}
| Doctrine_Template::setTableDefinition |
( |
| ) |
|
|
inherited |
Blank method for template table definition
- Returns
- void
Definition at line 201 of file Template.php.
| Doctrine_Template_Searchable::setUp |
( |
| ) |
|
Setup the Searchable template behavior
- Returns
- void
Definition at line 52 of file Searchable.php.
{
$this->_plugin->initialize($this->_table);
}
| Doctrine_Record_Abstract::unique |
( |
|
$fields, |
|
|
|
$options = array(), |
|
|
|
$createUniqueIndex = true |
|
) |
| |
|
inherited |
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 Also
- export().
- Parameters
-
| 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 |
- Returns
- void
Definition at line 128 of file Abstract.php.
{
return $this->_table->unique($fields, $options, $createUniqueIndex);
}
| Doctrine_Record_Abstract::$_table |
|
protectedinherited |
The documentation for this class was generated from the following file: