/**
  * Return email templates grouped by module name
  *
  * @param void
  * @return array
  */
 function findGrouped()
 {
     $all = EmailTemplates::find(array('order' => 'module, name'));
     $result = null;
     if (is_foreachable($all)) {
         $result = array();
         foreach ($all as $template) {
             $module = $template->getModule();
             if (!isset($result[$module])) {
                 $result[$module] = array();
             }
             // if
             $result[$module][] = $template;
         }
         // foreach
     }
     // if
     return $result;
 }