Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-104

Junk annotation code generated using convert mapping

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-ALPHA2
    • Fix Version/s: 2.0-ALPHA3
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None
    • Environment:
      Issue occurs in trunk

      Description

      When generating annotation from yaml
      ./doctrine convert-mapping --from=./yaml/ --to=annotation --dest=.

      with one already generated yaml file and one new yaml file

      annotation of first yaml is appended to the new annotations.

      Cause of the problem is in AnnotationExporter. ($this->_currentCode is not cleared.)

      public function exportClassMetadata(ClassMetadataInfo $metadata)
      {
      if (file_exists($this->_outputPath))

      { $this->_currentCode = file_get_contents($this->_outputPath); }

      Solution :

      if (file_exists($this->_outputPath))

      { $this->_currentCode = file_get_contents($this->_outputPath); }

      else

      { $this->_currentCode = ''; }

        Activity

        Hide
        Eric Durand-Tremblay added a comment -

        This does not solve completely the issue.

        Updating the same annotation class from yaml often generate junk code.

        Show
        Eric Durand-Tremblay added a comment - This does not solve completely the issue. Updating the same annotation class from yaml often generate junk code.

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Eric Durand-Tremblay
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: