Esempio n. 1
0
 public function onLoad(DotArray $incoming, $prefix = null)
 {
     $options_key = $prefix ? $prefix . '._options' : '_options';
     $incoming_options = $incoming->exists($options_key) ? $incoming->get($options_key) : [];
     $this->options = array_merge($this->options, $incoming_options);
     $incoming->remove($options_key);
 }
Esempio n. 2
0
 public function testExists()
 {
     $d = new DotArray($this->arr);
     $this->assertTrue($d->exists('one'));
     $this->assertTrue($d->exists('two.two'));
     $this->assertFalse($d->exists('foo.bar'));
     $d->set('two.two', false);
     $this->assertTrue($d->exists('two.two'));
     $d->remove('two.two');
     $this->assertFalse($d->exists('two.two'));
     $d->set('two.two', null);
     $this->assertFalse($d->exists('two.two'));
 }