Exemplo n.º 1
0
 /**
  *
  */
 public function update($iterable)
 {
     if ($iterable !== null) {
         if ($iterable instanceof Mapping) {
             if (count($this) > 0) {
                 foreach ($iterable->items() as list($elem, $count)) {
                     $this[$elem] = $count + $this->get($elem, 0);
                 }
             } else {
                 parent::update($iterable);
             }
         } else {
             foreach ($iterable as $elem) {
                 $this[$elem] = $this->get($elem, 0) + 1;
             }
         }
     }
 }