Doctrine 1
  1. Doctrine 1
  2. DC-211

Generated phpdoc relations comments doesn't include classPrefix

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2.0-BETA2
    • Fix Version/s: 1.2.0-BETA3
    • Component/s: Import/Export
    • Labels:
      None

      Description

      When generating models like this:

      'pearStyle' => true,
      'generateTableClasses' => true,
      'classPrefix' => 'Model_',
      'baseClassPrefix' => 'Base_',
      'baseClassesDirectory' => null,
      'classPrefixFiles' => false,
      'generateAccessors' => false,

      Or any other similar style which includes models prefix, comments generated are like this:

      /**
      * Model_Base_Class
      *
      * This class has been auto-generated by the Doctrine ORM Framework
      *
      * @property integer $id
      * @property Operators $Operators
      *
      * @package -
      * @subpackage -
      * @author -
      * @version SVN: $Id: Builder.php 6698 2009-11-10 17:58:02Z jwage $
      */

      Problem is with line "@property Operators $Operators" which is incorrect (even though reference is correct in code: "Model_Operators as Operators").

      After digging in builder it seems that in lines 628-633 of Doctrine_Import_Builder

      if (isset($definition['relations']) && ! empty($definition['relations'])) {
      foreach ($definition['relations'] as $relation) {
      $type = (isset($relation['type']) && $relation['type'] == Doctrine_Relation::MANY) ? 'Doctrine_Collection':$relation['class'];
      $ret[] = '@property ' . $type . ' $' . $relation['alias'];
      }
      }

      Here the $relation['class'] doesn't have full name, even though same key is used in lines 384-395:

      $class = isset($relation['class']) ? $relation['class']:$name;
      $alias = (isset($relation['alias']) && $relation['alias'] !== $this->_classPrefix . $relation['class']) ? ' as ' . $relation['alias'] : '';

      if ( ! isset($relation['type'])) {
      $relation['type'] = Doctrine_Relation::ONE;
      }

      if ($relation['type'] === Doctrine_Relation::ONE)\

      Unknown macro: { $ret[$i] = " ".'$this->hasOne('' . $class . $alias . ''';\}

      else {
      $ret[$i] = " ".'$this->hasMany(\'' . $class . $alias . '\'';
      }

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Juozas Kaziukenas
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: