public function registerBadge(BadgeInterface $badge)
 {
     $namespace = $badge->getNamespace();
     $name = $badge->getName();
     $badgeArray = array("{$namespace}.{$name}" => $badge->getData());
     $this->getPerson()->mergeBadges($badgeArray);
 }
Пример #2
0
 public function setCount(BadgeInterface $badge, $count)
 {
     $namespace = $badge->getNamespace();
     $name = $badge->getName();
     if (!array_key_exists($namespace, $this->count)) {
         $this->count[$namespace] = array($name => $count);
     } else {
         $this->count[$namespace][$name] = $count;
     }
     return $this;
 }