1
0
mirror of synced 2025-01-19 06:51:40 +03:00

Removed deprecated constants

This commit is contained in:
zYne 2006-09-20 21:18:41 +00:00
parent 92d4bb2286
commit 935fbb5520
5 changed files with 20 additions and 46 deletions

View File

@ -117,14 +117,6 @@ final class Doctrine {
* batch size attribute * batch size attribute
*/ */
const ATTR_BATCH_SIZE = 8; 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 * locking attribute
*/ */
@ -283,20 +275,6 @@ final class Doctrine {
* mode for pessimistic locking * mode for pessimistic locking
*/ */
const LOCK_PESSIMISTIC = 1; 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 * constructor
*/ */

View File

@ -76,15 +76,6 @@ abstract class Doctrine_Configurable {
case Doctrine::ATTR_LISTENER: case Doctrine::ATTR_LISTENER:
$this->setEventListener($value); $this->setEventListener($value);
break; 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: case Doctrine::ATTR_LOCKMODE:
if($this instanceof Doctrine_Connection) { if($this instanceof Doctrine_Connection) {
if($this->getTransaction()->getState() != Doctrine_Connection_Transaction::STATE_OPEN) if($this->getTransaction()->getState() != Doctrine_Connection_Transaction::STATE_OPEN)

View File

@ -82,8 +82,6 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
Doctrine::ATTR_BATCH_SIZE => 5, Doctrine::ATTR_BATCH_SIZE => 5,
Doctrine::ATTR_COLL_LIMIT => 5, Doctrine::ATTR_COLL_LIMIT => 5,
Doctrine::ATTR_LISTENER => new Doctrine_EventListener_Empty(), 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_LOCKMODE => 1,
Doctrine::ATTR_VLD => false, Doctrine::ATTR_VLD => false,
Doctrine::ATTR_CREATE_TABLES => true, Doctrine::ATTR_CREATE_TABLES => true,

View File

@ -1,4 +1,23 @@
<?php <?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 * Doctrine_Repository
* each record is added into Doctrine_Repository at the same time they are created, * each record is added into Doctrine_Repository at the same time they are created,
@ -8,8 +27,6 @@
* @package Doctrine ORM * @package Doctrine ORM
* @url www.phpdoctrine.com * @url www.phpdoctrine.com
* @license LGPL * @license LGPL
* @version 1.0 alpha
*
*/ */
class Doctrine_Repository implements Countable, IteratorAggregate { class Doctrine_Repository implements Countable, IteratorAggregate {
/** /**

View File

@ -25,12 +25,6 @@ class Doctrine_ConfigurableTestCase extends Doctrine_UnitTestCase {
$this->manager->setAttribute(Doctrine::ATTR_LISTENER, new Doctrine_EventListener_Debugger()); $this->manager->setAttribute(Doctrine::ATTR_LISTENER, new Doctrine_EventListener_Debugger());
$this->assertTrue($this->manager->getAttribute(Doctrine::ATTR_LISTENER) instanceof 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->manager->setAttribute(Doctrine::ATTR_LOCKMODE, Doctrine::LOCK_PESSIMISTIC);
$this->assertEqual($this->manager->getAttribute(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->assertTrue($e instanceof Exception);
$this->connection->commit(); $this->connection->commit();
} }
try {
$this->manager->setAttribute(Doctrine::ATTR_PK_TYPE,-12);
} catch(Exception $e) {
$this->assertTrue($e instanceof Exception);
}
} }
public function testGetAttributes() { public function testGetAttributes() {
$this->assertTrue(is_array($this->manager->getAttributes())); $this->assertTrue(is_array($this->manager->getAttributes()));