Commit 6daa1e34 authored by zYne's avatar zYne

fixed references to deprecated getTransaction() and getUnitOfWork() methods

parent 4f361df6
......@@ -47,7 +47,7 @@ abstract class Doctrine_Configurable {
*
* <code>
* $manager->setAttribute(Doctrine::ATTR_PORTABILITY, Doctrine::PORTABILITY_ALL);
*
*
* // or
*
* $manager->setAttribute('portability', Doctrine::PORTABILITY_ALL);
......@@ -76,12 +76,12 @@ abstract class Doctrine_Configurable {
break;
case Doctrine::ATTR_LOCKMODE:
if($this instanceof Doctrine_Connection) {
if($this->getTransaction()->getState() != Doctrine_Connection_Transaction::STATE_OPEN)
if($this->transaction->getState() != Doctrine_Connection_Transaction::STATE_OPEN)
throw new Doctrine_Exception("Couldn't set lockmode. There are transactions open.");
} elseif($this instanceof Doctrine_Manager) {
foreach($this as $connection) {
if($connection->getTransaction()->getState() != Doctrine_Connection_Transaction::STATE_OPEN)
if($connection->transaction->getState() != Doctrine_Connection_Transaction::STATE_OPEN)
throw new Doctrine_Exception("Couldn't set lockmode. There are transactions open.");
}
} else {
......
......@@ -864,12 +864,12 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
$conn->beginTransaction();
$saveLater = $conn->getUnitOfWork()->saveRelated($this);
$saveLater = $conn->unitOfWork->saveRelated($this);
if ($this->isValid()) {
$conn->save($this);
} else {
$conn->getTransaction()->addInvalid($this);
$conn->transaction->addInvalid($this);
}
foreach($saveLater as $fk) {
......@@ -884,7 +884,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
// save the MANY-TO-MANY associations
$conn->getUnitOfWork()->saveAssociations($this);
$conn->unitOfWork->saveAssociations($this);
//$this->saveAssociations();
$conn->commit();
......
This diff is collapsed.
......@@ -30,6 +30,7 @@ class Doctrine_UnitTestCase extends UnitTestCase {
protected $users;
protected $valueHolder;
protected $tables = array();
protected $unitOfWork;
private $init = false;
......@@ -79,7 +80,7 @@ class Doctrine_UnitTestCase extends UnitTestCase {
$this->listener = new Doctrine_EventListener_Debugger();
$this->manager->setAttribute(Doctrine::ATTR_LISTENER, $this->listener);
}
$this->unitOfWork = $this->connection->unitOfWork;
$this->connection->setListener(new Doctrine_EventListener());
$this->query = new Doctrine_Query($this->connection);
$this->prepareTables();
......
......@@ -43,6 +43,8 @@ require_once('QueryShortAliasesTestCase.php');
require_once('QueryDeleteTestCase.php');
require_once('QueryUpdateTestCase.php');
require_once('UnitOfWorkTestCase.php');
require_once('RelationAccessTestCase.php');
require_once('RelationTestCase.php');
require_once('RelationManyToManyTestCase.php');
......@@ -67,6 +69,10 @@ print '<pre>';
$test = new GroupTest('Doctrine Framework Unit Tests');
$test->addTestCase(new Doctrine_UnitOfWork_TestCase());
$test->addTestCase(new Doctrine_ConnectionTestCase());
$test->addTestCase(new Doctrine_Db_TestCase());
$test->addTestCase(new Doctrine_Db_Profiler_TestCase());
......@@ -75,8 +81,6 @@ $test->addTestCase(new Doctrine_Query_MultiJoin_TestCase());
$test->addTestCase(new Doctrine_Record_TestCase());
$test->addTestCase(new Doctrine_ConnectionTestCase());
$test->addTestCase(new Doctrine_DataDict_Pgsql_TestCase());
$test->addTestCase(new Doctrine_Relation_ManyToMany_TestCase());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment