1
0
mirror of synced 2025-01-17 22:11:41 +03:00

Throw exception on deprecated attributes

This commit is contained in:
jackbravo 2007-09-04 16:36:12 +00:00
parent 49053d654f
commit 5ae71f676e

View File

@ -80,18 +80,13 @@ abstract class Doctrine_Configurable extends Doctrine_Object
}
switch ($attribute) {
case Doctrine::ATTR_FETCHMODE:
if ($value < 0) {
throw new Doctrine_Exception("Unknown fetchmode. See Doctrine::FETCH_* constants.");
}
break;
case Doctrine::ATTR_COLL_LIMIT:
case Doctrine::ATTR_ACCESSOR_PREFIX_GET:
case Doctrine::ATTR_ACCESSOR_PREFIX_SET:
throw new Doctrine_Exception('Deprecated attribute. See http://doctrine.pengus.net/doctrine/manual/new/?chapter=configuration');
case Doctrine::ATTR_LISTENER:
$this->setEventListener($value);
break;
case Doctrine::ATTR_COLL_LIMIT:
if ($value < 1) {
throw new Doctrine_Exception("Collection limit should be a value greater than or equal to 1.");
}
break;
case Doctrine::ATTR_COLL_KEY:
if ( ! ($this instanceof Doctrine_Table)) {
throw new Doctrine_Exception("This attribute can only be set at table level.");
@ -116,8 +111,6 @@ abstract class Doctrine_Configurable extends Doctrine_Object
case Doctrine::ATTR_QUOTE_IDENTIFIER:
case Doctrine::ATTR_PORTABILITY:
case Doctrine::ATTR_DEFAULT_TABLE_TYPE:
case Doctrine::ATTR_ACCESSOR_PREFIX_GET:
case Doctrine::ATTR_ACCESSOR_PREFIX_SET:
case Doctrine::ATTR_EMULATE_DATABASE:
case Doctrine::ATTR_USE_NATIVE_ENUM:
case Doctrine::ATTR_DEFAULT_SEQUENCE: