コード例 #1
0
ファイル: FormNotifications.php プロジェクト: xert/icingaweb2
 /**
  * Recurse the given form and return the notifications for it and all of its subforms
  *
  * @param   Form    $form       The form to recurse
  *
  * @return array
  */
 protected function recurseForm(Form $form)
 {
     $notifications = $form->getNotifications();
     foreach ($form->getSubForms() as $subForm) {
         $notifications = $notifications + $this->recurseForm($subForm);
     }
     return $notifications;
 }
コード例 #2
0
 /**
  * Recurse the given form and return the notifications for it and all of its subforms
  *
  * @param   Form    $form   The form to recurse
  *
  * @return  array
  */
 protected function recurseForm(Form $form)
 {
     $notifications = $form->getNotifications();
     foreach ($form->getSubForms() as $subForm) {
         foreach ($this->recurseForm($subForm) as $type => $messages) {
             foreach ($messages as $message) {
                 $notifications[$type][] = $message;
             }
         }
     }
     return $notifications;
 }