Source for file Configurable.php
Documentation is available at Configurable.php
* $Id: Configurable.php 2153 2007-08-03 11:52:24Z zYne $
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
* the base for Doctrine_Table, Doctrine_Manager and Doctrine_Connection
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @category Object Relational Mapping
* @link www.phpdoctrine.com
* @version $Revision: 2153 $
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @var array $attributes an array of containing all attributes
* @var Doctrine_Configurable $parent the parent of this component
* @var array $_impl an array containing concrete implementations for class templates
* keys as template names and values as names of the concrete
* $manager->setAttribute(Doctrine::ATTR_PORTABILITY, Doctrine::PORTABILITY_ALL);
* $manager->setAttribute('portability', Doctrine::PORTABILITY_ALL);
* @param mixed $attribute either a Doctrine::ATTR_* integer constant or a string
* corresponding to a constant
* @param mixed $value the value of the attribute
* @see Doctrine::ATTR_* constants
* @throws Doctrine_Exception if the value is invalid
$const =
'Doctrine::ATTR_' .
$attribute;
throw
new Doctrine_Exception("ATTR_CREATE_TABLES has been deprecated. See exporting in the first chapter of the manual.");
throw
new Doctrine_Exception("Get / Set filtering is deprecated (slowed down Doctrine too much).");
throw
new Doctrine_Exception("Collection limit should be a value greater than or equal to 1.");
if ($value !==
null &&
! $this->hasColumn($value)) {
throw
new Doctrine_Exception("Couldn't set collection key attribute. No such column '$value'");
case Doctrine::ATTR_ACCESSOR_PREFIX_GET:
case Doctrine::ATTR_ACCESSOR_PREFIX_SET:
throw
new Doctrine_Exception('Sequence column name attribute only accepts string values');
if ($value !=
0 &&
$value !=
CASE_LOWER &&
$value !=
CASE_UPPER)
throw
new Doctrine_Exception('Field case attribute should be either 0, CASE_LOWER or CASE_UPPER constant.');
.
'at table level (only at connection or global level).');
* binds given class to given template name
* this method is the base of Doctrine dependency injection
* @param string $template name of the class template
* @param string $class name of the class to be bound
* @return Doctrine_Configurable this object
public function setImpl($template, $class)
$this->_impl[$template] =
$class;
* returns the implementation for given class
* @return string name of the concrete implementation
if ( ! isset
($this->_impl[$template])) {
return $this->_impl[$template];
* @return Doctrine_Cache_Interface
* @param Doctrine_EventListener $listener
* @param Doctrine_EventListener_Interface|Doctrine_Overloadable$listener
* @return mixed this object
* @return Doctrine_EventListener_Interface|Doctrine_Overloadable
* @param Doctrine_EventListener_Interface|Doctrine_Overloadable$listener
* @return Doctrine_Configurable this object
throw
new Doctrine_Exception("Couldn't set eventlistener. Record listeners should implement either Doctrine_Record_Listener_Interface or Doctrine_Overloadable");
* @param Doctrine_EventListener_Interface|Doctrine_Overloadable$listener
* @return mixed this object
* @return Doctrine_EventListener_Interface|Doctrine_Overloadable
* @param Doctrine_EventListener_Interface|Doctrine_Overloadable$listener
* @return Doctrine_Configurable this object
throw
new Doctrine_EventListener_Exception("Couldn't set eventlistener. EventListeners should implement either Doctrine_EventListener_Interface or Doctrine_Overloadable");
* returns the value of an attribute
* @param integer $attribute
$attribute = (int)
$attribute;
* returns all attributes as an array
* sets a parent for this configurable component
* the parent must be configurable component itself
* @param Doctrine_Configurable $component
public function setParent(Doctrine_Configurable $component)
* returns the parent of this component
* @return Doctrine_Configurable