Example #1
0
 public function test_offset()
 {
     $arc = new ArrayCollection(array('aap', 'aap', 'noot', 'mies'));
     $this->assertTrue($arc->offsetExists(0));
     $this->assertTrue($arc->offsetExists(1));
     $this->assertFalse($arc->offsetExists(4));
     $this->assertEquals($arc->offsetGet(0), 'aap');
     $this->assertEquals($arc->offsetGet(2), 'noot');
     $arc->offsetSet(2, 'zus');
     $this->assertEquals($arc->offsetGet(2), 'zus');
     $arc->offsetUnset(0);
     $this->assertFalse($arc->offsetExists(0));
     $this->assertTrue($arc->offsetExists(1));
 }
Example #2
0
 /** {@inheritDoc} */
 public function offsetSet($offset, $value)
 {
     $this->initialize();
     $this->isDirty = true;
     return $this->collection->offsetSet($offset, $value);
 }
 public function offsetSet($offset, $value)
 {
     $this->initialize();
     $this->changed = true;
     return $this->col->offsetSet($offset, $value);
 }