Commit da6f4a38 authored by zYne's avatar zYne

Fixes #166

parent 2e8f73db
......@@ -481,7 +481,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
* @param Doctrine_Record $record
* @return void
*/
public function set($key,Doctrine_Record $record) {
public function set($key, Doctrine_Record $record) {
if(isset($this->reference_field))
$record->set($this->reference_field, $this->reference, false);
......
......@@ -321,11 +321,11 @@ abstract class Doctrine_Hydrate extends Doctrine_Access {
$stmt = $this->connection->execute($query,$params);
if($this->aggregate)
if($this->aggregate)
return $stmt->fetchAll(PDO::FETCH_ASSOC);
if(count($this->tables) == 0)
throw new Doctrine_Exception("No tables selected");
throw new Doctrine_Query_Exception("No components selected");
$keys = array_keys($this->tables);
$root = $keys[0];
......
This diff is collapsed.
......@@ -15,7 +15,7 @@ class User extends Doctrine_Record {
if ($this->name == 'God') {
// Blasphemy! Stop that! ;-)
// syntax: add(<fieldName>, <error code/identifier>)
$this->errorStack->add('name', 'forbiddenName');
$this->getErrorStack()->add('name', 'forbiddenName');
}
}
}
......
......@@ -101,17 +101,17 @@ class User extends Entity {
public function validate() {
// Allow only one name!
if ($this->name !== 'The Saint') {
$this->errorStack->add('name', 'notTheSaint');
$this->getErrorStack()->add('name', 'notTheSaint');
}
}
public function validateOnInsert() {
if ($this->password !== 'Top Secret') {
$this->errorStack->add('password', 'pwNotTopSecret');
$this->getErrorStack()->add('password', 'pwNotTopSecret');
}
}
public function validateOnUpdate() {
if ($this->loginname !== 'Nobody') {
$this->errorStack->add('loginname', 'notNobody');
$this->getErrorStack()->add('loginname', 'notNobody');
}
}
}
......
......@@ -52,17 +52,18 @@ error_reporting(E_ALL);
print "<pre>";
$test = new GroupTest("Doctrine Framework Unit Tests");
$test->addTestCase(new Doctrine_RecordTestCase());
$test->addTestCase(new Doctrine_ValidatorTestCase());
$test->addTestCase(new Doctrine_Query_MultiJoin_TestCase());
$test->addTestCase(new Doctrine_Relation_TestCase());
$test->addTestCase(new Doctrine_EventListenerTestCase());
$test->addTestCase(new Doctrine_RecordTestCase());
$test->addTestCase(new Doctrine_Connection_Transaction_TestCase());
$test->addTestCase(new Doctrine_ConnectionTestCase());
......
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