/** * {@inheritdoc} * * @throws UnexpectedValueException */ public function set($key, $value) { if (!$this->acceptsType($value)) { throw $this->doUnexpectedValueError($value); } parent::set($key, $value); }
public function test_construct_get_add_set() { $arc = new ArrayCollection(array('aap', 'aap', 'noot')); $this->assertEquals($arc->get(0), 'aap'); $this->assertEquals($arc->get(1), 'aap'); $this->assertEquals($arc->get(2), 'noot'); $this->assertNull($arc->get(3)); $arc->add('mies'); $this->assertEquals($arc->get(0), 'aap'); $this->assertEquals($arc->get(1), 'aap'); $this->assertEquals($arc->get(2), 'noot'); $this->assertEquals($arc->get(3), 'mies'); $arc->set(1, 'mies'); $this->assertEquals($arc->get(0), 'aap'); $this->assertEquals($arc->get(1), 'mies'); $this->assertEquals($arc->get(2), 'noot'); $this->assertEquals($arc->get(3), 'mies'); }
/** {@inheritDoc} */ public function set($key, $value) { $this->initialize(); $this->isDirty = true; return $this->collection->set($key, $value); }
public function set($key, $value) { $this->initialize(); $this->changed = true; return $this->col->set($key, $value); }
public static function GetAll() { // Collection<Plan> $planes = Plan::getAll(); // Collection<PlanLogica> planeslogica = new ArrayList<PlanLogica>(); $planeslogica = new ArrayCollection(); // Iterator<Plan> it = planes.iterator(); // while (it.hasNext()) foreach ($planes as $plan) { // PlanLogica $pl = new PlanLogica($plan); // planeslogica.add(pl); $planeslogica->set($pl->ID, $pl); } return $planeslogica; }