Doctrine 1
  1. Doctrine 1
  2. DC-178

Import Builder doesn't use default table class name

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.0-ALPHA1, 1.2.0-ALPHA2, 1.2.0-ALPHA3, 1.2.0-BETA1
    • Fix Version/s: 1.2.0-BETA2
    • Labels:
      None

      Description

      I use Symfony 1.2.9 with Doctrine 1.2 trunk.

      I also make use of the new Doctrine's feature to specify custom table class. For that, in the config/ProjectConfiguration.class.php I have the following code:

         public function configureDoctrine(Doctrine_Manager $manager)
         {
            ...
            $manager->setAttribute(Doctrine::ATTR_TABLE_CLASS, 'Platform_DoctrineTable');
            ...
         }
      

      And that works fine. But when I comment out this line and re-generate model classes, I get broken table class definitions like:

      class AccountTable extends 
      {
      
      }
      

      Notice the lack of base class name.

      It seems the problem resides in Doctrine_Import_Builder's constructor:

          public function __construct()
          {
              $this->_baseTableClassName = Doctrine_Manager::getInstance()->getAttribute(Doctrine_Core::ATTR_TABLE_CLASS);
              $this->loadTemplate();
          }
      

      So, the default value of $this->_baseTableClassName always overwrites by Doctrine_Core::ATTR_TABLE_CLASS attribute value.

      1. DC-178.patch
        0.6 kB
        Eugene Janusov

        Activity

        Hide
        Eugene Janusov added a comment -

        Proposed patch attached.

        Show
        Eugene Janusov added a comment - Proposed patch attached.

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Eugene Janusov
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: