mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Warning: Illegal offset type in isset or empty In ArrayCollection.php line 133 #6212
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @liveisdestiny on GitHub (Apr 2, 2019).
Originally assigned to: @Ocramius on GitHub.
Bug Report
Summary
Removing an Entity from Array Collection throws the error. The collection contains the element and it is checked with contains method before without problems
Current behavior
How to reproduce
Create a Symfony console command (CC) and an entity (Roles). Now try to remove another Entity (User) form the List:
CC:
Roles:
ArrayCollection:
The problem caused on
$this->elements[$key]Expected behavior
It should remove the Entity (User) from the Collection but it throws an exception. Adding it works fine
@Ocramius commented on GitHub (Apr 2, 2019):
You are looking for
Collection#removeElement()