Removed deprecated constants
This commit is contained in:
parent
92d4bb2286
commit
935fbb5520
22
Doctrine.php
22
Doctrine.php
@ -117,14 +117,6 @@ final class Doctrine {
|
||||
* batch size attribute
|
||||
*/
|
||||
const ATTR_BATCH_SIZE = 8;
|
||||
/**
|
||||
* primary key columns attribute
|
||||
*/
|
||||
const ATTR_PK_COLUMNS = 9;
|
||||
/**
|
||||
* primary key type attribute
|
||||
*/
|
||||
const ATTR_PK_TYPE = 10;
|
||||
/**
|
||||
* locking attribute
|
||||
*/
|
||||
@ -283,20 +275,6 @@ final class Doctrine {
|
||||
* mode for pessimistic locking
|
||||
*/
|
||||
const LOCK_PESSIMISTIC = 1;
|
||||
|
||||
/**
|
||||
* PRIMARY KEY TYPE CONSTANTS
|
||||
*/
|
||||
|
||||
/**
|
||||
* auto-incremented/(sequence updated) primary key
|
||||
*/
|
||||
const INCREMENT_KEY = 0;
|
||||
/**
|
||||
* unique key
|
||||
*/
|
||||
const UNIQUE_KEY = 1;
|
||||
|
||||
/**
|
||||
* constructor
|
||||
*/
|
||||
|
@ -76,15 +76,6 @@ abstract class Doctrine_Configurable {
|
||||
case Doctrine::ATTR_LISTENER:
|
||||
$this->setEventListener($value);
|
||||
break;
|
||||
case Doctrine::ATTR_PK_COLUMNS:
|
||||
if( ! is_array($value))
|
||||
throw new Doctrine_Exception("The value of Doctrine::ATTR_PK_COLUMNS attribute must be an array");
|
||||
break;
|
||||
case Doctrine::ATTR_PK_TYPE:
|
||||
if($value != Doctrine::INCREMENT_KEY && $value != Doctrine::UNIQUE_KEY)
|
||||
throw new Doctrine_Exception("The value of Doctrine::ATTR_PK_TYPE attribute must be either Doctrine::INCREMENT_KEY or Doctrine::UNIQUE_KEY");
|
||||
|
||||
break;
|
||||
case Doctrine::ATTR_LOCKMODE:
|
||||
if($this instanceof Doctrine_Connection) {
|
||||
if($this->getTransaction()->getState() != Doctrine_Connection_Transaction::STATE_OPEN)
|
||||
|
@ -82,8 +82,6 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
|
||||
Doctrine::ATTR_BATCH_SIZE => 5,
|
||||
Doctrine::ATTR_COLL_LIMIT => 5,
|
||||
Doctrine::ATTR_LISTENER => new Doctrine_EventListener_Empty(),
|
||||
Doctrine::ATTR_PK_COLUMNS => array("id"),
|
||||
Doctrine::ATTR_PK_TYPE => Doctrine::INCREMENT_KEY,
|
||||
Doctrine::ATTR_LOCKMODE => 1,
|
||||
Doctrine::ATTR_VLD => false,
|
||||
Doctrine::ATTR_CREATE_TABLES => true,
|
||||
|
@ -1,4 +1,23 @@
|
||||
<?php
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* 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>.
|
||||
*/
|
||||
/**
|
||||
* Doctrine_Repository
|
||||
* each record is added into Doctrine_Repository at the same time they are created,
|
||||
@ -8,8 +27,6 @@
|
||||
* @package Doctrine ORM
|
||||
* @url www.phpdoctrine.com
|
||||
* @license LGPL
|
||||
* @version 1.0 alpha
|
||||
*
|
||||
*/
|
||||
class Doctrine_Repository implements Countable, IteratorAggregate {
|
||||
/**
|
||||
|
@ -25,12 +25,6 @@ class Doctrine_ConfigurableTestCase extends Doctrine_UnitTestCase {
|
||||
$this->manager->setAttribute(Doctrine::ATTR_LISTENER, new Doctrine_EventListener_Debugger());
|
||||
$this->assertTrue($this->manager->getAttribute(Doctrine::ATTR_LISTENER) instanceof Doctrine_EventListener_Debugger);
|
||||
|
||||
$this->manager->setAttribute(Doctrine::ATTR_PK_COLUMNS, array("id"));
|
||||
$this->assertEqual($this->manager->getAttribute(Doctrine::ATTR_PK_COLUMNS), array("id"));
|
||||
|
||||
$this->manager->setAttribute(Doctrine::ATTR_PK_TYPE, Doctrine::INCREMENT_KEY);
|
||||
$this->assertEqual($this->manager->getAttribute(Doctrine::ATTR_PK_TYPE), Doctrine::INCREMENT_KEY);
|
||||
|
||||
$this->manager->setAttribute(Doctrine::ATTR_LOCKMODE, Doctrine::LOCK_PESSIMISTIC);
|
||||
$this->assertEqual($this->manager->getAttribute(Doctrine::ATTR_LOCKMODE), Doctrine::LOCK_PESSIMISTIC);
|
||||
|
||||
@ -88,11 +82,7 @@ class Doctrine_ConfigurableTestCase extends Doctrine_UnitTestCase {
|
||||
$this->assertTrue($e instanceof Exception);
|
||||
$this->connection->commit();
|
||||
}
|
||||
try {
|
||||
$this->manager->setAttribute(Doctrine::ATTR_PK_TYPE,-12);
|
||||
} catch(Exception $e) {
|
||||
$this->assertTrue($e instanceof Exception);
|
||||
}
|
||||
|
||||
}
|
||||
public function testGetAttributes() {
|
||||
$this->assertTrue(is_array($this->manager->getAttributes()));
|
||||
|
Loading…
Reference in New Issue
Block a user