Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.2.0, 1.2.1
-
Fix Version/s: None
-
Component/s: Connection
-
Labels:None
-
Environment:Ubuntu 8.04
Description
Hi!
Im not quite sure it this bahaviour is wanted, but i think that this
should be catched:
If i call Doctrine::getTable on a non existing model, the exception is
thrown. After them i want always to clear all Record Repositories, see
code:
try
{ $table = Doctrine::getTable('notexistent'); }catch(Exception $e)
{ echo 'not existent'.$e->getMessage(); }Doctrine_Manager::connection()->clear();
Then I get the error message:
Fatal error: Call to a member function evictAll() on a non-object in /
core/lib/Doctrine/Doctrine/Connection.php on line 1239
The problem is that the function clear doesnt check if a repository is
given.
public function clear()
{
foreach ($this->tables as $k => $table)
}
Is it normal behaviour? Or should it be checked first:
if ($repository = $table->getRepository())
{ $repository->evisctAll(); }best regards,
aNj