Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.2.2
-
Fix Version/s: None
-
Component/s: Behaviors
-
Labels:None
Description
I feel curios when looking setImpl code on Doctrine. It set like this:
public function setImpl($template, $class) { $this->_impl[$template] = $class; return $this; }
I've made a template:
class PersonTemplate extends Doctrine_Template { public function setTableDefinition() { //... Person fields (e.g. name, address, etc.) } }
Now I create 2 class that implement PersonTemplate
class Student extends Doctrine_Record { public function setUp() { $this->actAs('PersonTemplate'); } }
class Teacher extends Doctrine_Record { public function setUp() { $this->actAs('PersonTemplate'); } }
Then I set implementation on Doctrine_Manager:
Doctrine_Manager::getInstance()->setImpl('PersonTemplate', 'Student')->setImpl('PersonTemplate', 'Teacher');
Now isn't it only Teacher record recognized as implementation of PersonTemplate ( when we see from this code: $this->_impl[$template] = $class; )
So how we can implement a template into seperated different doctrine record?
Activity
This list may be incomplete, as errors occurred whilst retrieving source from linked applications:
- Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DC-801, expand=changesets[-21:-1].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)
As the doc says "Tip The implementations for the templates can be set at manager, connection and even at the table level." it is supposed one can do:
Doctrine_Manager::getInstance()->getTable('Student')->setImpl('PersonTemplate', 'Student'); Doctrine_Manager::getInstance()->getTable('Teacher')->setImpl('PersonTemplate', 'Teacher');but for me it throws an exception:
"Couldn't find concrete implementation for template PersonTemplate"
thx