/**
* Actual logic for setting an element in the collection.
*
* @param mixed $offset
* @param mixed $value
* @param bool $arrayAccess
* @return bool
*/
private function doSet($offset, $value, $arrayAccess)
{
$arrayAccess ? $this->coll->offsetSet($offset, $value) : $this->coll->set($offset, $value);
// Handle orphanRemoval
if ($this->uow !== null && $this->isOrphanRemovalEnabled() && $value !== null) {
$this->uow->unscheduleOrphanRemoval($value);
}
$this->changed();
}