コード例 #1
0
 /**
  * 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();
 }
コード例 #2
0
 /**
  * {@inheritDoc}
  */
 public function offsetSet($offset, $value)
 {
     $this->initialize();
     $this->collection->offsetSet($offset, $value);
 }
コード例 #3
0
ファイル: TypedCollectionSpec.php プロジェクト: Rybbow/x-blog
 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();
 }
コード例 #4
0
ファイル: BlockProperty.php プロジェクト: sitesupra/sitesupra
 /**
  * @param BlockPropertyMetadata $metadata
  */
 public function addMetadata(BlockPropertyMetadata $metadata)
 {
     $name = $metadata->getName();
     $this->metadata->offsetSet($name, $metadata);
 }
コード例 #5
0
 public function offsetSet($offset, $value)
 {
     $this->initialize();
     $this->changed = true;
     return $this->col->offsetSet($offset, $value);
 }