Exemplo n.º 1
0
 protected function drawGroups(OutputInterface $output, Group $group)
 {
     $output->writeln(Nette\Utils\Strings::padLeft('', $group->getDepth(), ' ') . '\\_ ' . $group->getName() . ":" . $group->getType());
     foreach ($group->getChild() as $v) {
         $this->drawGroups($output, $v);
     }
 }
Exemplo n.º 2
0
 public function addEmailToGroup(Email $email, Group $group)
 {
     $groups = $this->getGroups();
     if (!$group->containEmail($email)) {
         $this->database->table($this->config['group_email']['table'])->insert([$this->config['group_email']['groupId'] => $group->getId(), $this->config['group_email']['emailId'] => $email->getId()]);
     } else {
         throw new \Exception("Email '" . $email->getEmail() . "' is already in group '" . $group->getName() . "'");
     }
     $group->registerEmail($email);
     $groups->invalidateCache();
 }
Exemplo n.º 3
0
 /**
  * @param Group $child
  */
 protected function connectToChild(Group $child)
 {
     $this->child[$child->getId()] = $child;
 }