Reverting BC break: PersistentConnection#__construct()
now accepts null|array|Collection
again
This commit is contained in:
parent
4792b4f974
commit
e8c9cb2f23
@ -101,16 +101,18 @@ final class PersistentCollection extends AbstractLazyCollection implements Selec
|
|||||||
/**
|
/**
|
||||||
* Creates a new persistent collection.
|
* Creates a new persistent collection.
|
||||||
*
|
*
|
||||||
* @param EntityManagerInterface $em The EntityManager the collection will be associated with.
|
* @param EntityManagerInterface $em The EntityManager the collection will be associated with.
|
||||||
* @param ClassMetadata $class The class descriptor of the entity type of this collection.
|
* @param ClassMetadata $class The class descriptor of the entity type of this collection.
|
||||||
* @param Collection $coll The collection elements.
|
* @param Collection|array|null $collection The collection elements.
|
||||||
*/
|
*/
|
||||||
public function __construct(EntityManagerInterface $em, $class, $coll)
|
public function __construct(EntityManagerInterface $em, $class, $collection)
|
||||||
{
|
{
|
||||||
$this->collection = $coll;
|
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
$this->typeClass = $class;
|
$this->typeClass = $class;
|
||||||
$this->initialized = true;
|
$this->initialized = true;
|
||||||
|
$this->collection = $collection instanceof Collection
|
||||||
|
? $collection
|
||||||
|
: new ArrayCollection((array) $collection);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user