Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2303

@param wrong in Doctrine\ORM\PersistentCollection::__constructor Edit

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: ORM
    • Security Level: All
    • Labels:

      Description

      When i try to generate a new PersistentCollection like this:
      ###############################################
      $collection = new ArrayCollection();
      new \Doctrine\ORM\PersistentCollection(
      $this->getEntityManager(),
      new ClassMetadata(''),
      $collection
      );
      ###############################################
      i get an typ hinting error like
      "Expected array, got "Doctrine\Common\Collections\ArrayCollection"

      This could be fixed by changing the type hinting for the Doctrine\ORM\PersistentCollection::__constructor
      _From:_
      ###############################################
      /**

      • Creates a new persistent collection.
        *
      • @param EntityManager $em The EntityManager the collection will be associated with.
      • @param ClassMetadata $class The class descriptor of the entity type of this collection.
      • @param array $coll The collection elements.
        */
        public function __construct(EntityManager $em, $class, $coll)
        {
                                                                                                  1. _To:_
                                                                                                    ###############################################
                                                                                                    /**

      • Creates a new persistent collection.
        *
      • @param EntityManager $em The EntityManager the collection will be associated with.
      • @param ClassMetadata $class The class descriptor of the entity type of this collection.
      • @param \ArrayAccess $coll The collection elements.
        */
        public function __construct(EntityManager $em, $class, $coll)
        {
        ###############################################

        Activity

          People

          • Assignee:
            Marco Pivetta
            Reporter:
            Torsten Granek
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: