Beispiel #1
0
 /**
  *
  */
 public function testIteratingAttributes()
 {
     $this->bag->add('foo', 'bar');
     $this->bag->add('zee', 'bee');
     foreach ($this->bag as $key => $value) {
         $this->assertEquals($value, $this->bag->get($key));
     }
 }
Beispiel #2
0
 /**
  * Add a new entry to our attribute bag.
  *
  * @param $key
  * @param $value
  */
 public function add($key, $value)
 {
     if (!$this->attributes->has($key) && $value != null) {
         $this->attributes->add($key, $value);
     }
 }