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); } }
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(); }
/** * @param Group $child */ protected function connectToChild(Group $child) { $this->child[$child->getId()] = $child; }