Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
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)
{-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
_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
Torsten Granek
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Attachment | screenshot-1.jpg [ 11380 ] |
Torsten Granek
made changes -
| Attachment | screenshot-1.jpg [ 11380 ] |
Torsten Granek
made changes -
| Attachment | screenshot-1.jpg [ 11381 ] |
Marco Pivetta
made changes -
| Status | Open [ 1 ] | Closed [ 6 ] |
| Assignee | Benjamin Eberlei [ beberlei ] | Marco Pivetta [ ocramius ] |
| Resolution | Invalid [ 6 ] |
This list may be incomplete, as errors occurred whilst retrieving source from linked applications:
- Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-2303, expand=changesets[-21:-1].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)
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) {_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) {