Doctrine 1
  1. Doctrine 1
  2. DC-801

Multiple template implementation (setImpl)

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major 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

        B. Ariston Darmayuda created issue -

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            B. Ariston Darmayuda
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: