classes = new Container; } /** * Add a new notification type * * @access public * @param string $type * @param string $label * @param string $class * @param boolean $hidden * @return NotificationType */ public function setType($type, $label, $class, $hidden = false) { $container = $this->container; if ($hidden) { $this->hiddens[] = $type; } else { $this->labels[$type] = $label; } $this->classes[$type] = function () use ($class, $container) { return new $class($container); }; return $this; } /** * Get mail notification type instance * * @access public * @param string $type * @return NotificationInterface */ public function getType($type) { return $this->classes[$type]; } /** * Get all notification types with labels * * @access public * @return array */ public function getTypes() { return $this->labels; } /** * Get all hidden notification types * * @access public * @return array */ public function getHiddenTypes() { return $this->hiddens; } }