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);
 }
Beispiel #2
0
 /**
  * Set a configuration value with $key.
  * $key uses the dot array syntax: parent.child.child.
  * If $value is an array this will also be accessible using the
  * dot array syntax.
  */
 public function set($key, $value)
 {
     parent::set($key, $value);
     return $this;
 }
Beispiel #3
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'));
 }