/** * 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(); }
/** * {@inheritDoc} */ public function offsetSet($offset, $value) { $this->initialize(); $this->collection->offsetSet($offset, $value); }
function it_accepts_only_elements_of_specified_type_for_offset_set_method(Collection $internal) { $this->shouldThrow(new InvalidTypeException(4, 'string'))->during('offsetSet', [1, 4]); $internal->offsetSet(Argument::cetera())->shouldNotHaveBeenCalled(); }
/** * @param BlockPropertyMetadata $metadata */ public function addMetadata(BlockPropertyMetadata $metadata) { $name = $metadata->getName(); $this->metadata->offsetSet($name, $metadata); }
public function offsetSet($offset, $value) { $this->initialize(); $this->changed = true; return $this->col->offsetSet($offset, $value); }