contributions/usermanagement.notifications/behaviour/commands/notifications/digest.cmd.php
Go to the documentation of this file.00001 <?php 00002 /** 00003 * Send a digest based upon settings 00004 * 00005 * NOT transactional! Since Sending a Mail cannot be undone 00006 */ 00007 class DigestNotificationsCommand extends CommandBase { 00008 /** 00009 * Returns title of command. 00010 */ 00011 public function get_name() { 00012 return 'digest'; 00013 } 00014 00015 /** 00016 * Aktually do something :) 00017 */ 00018 public function execute() { 00019 Load::models('notificationssettings'); 00020 $ret = new Status(); 00021 00022 $possible_digests = NotificationsSettings::create_possible_digest_adapter(); 00023 $possible_digests->find(); 00024 while($possible_digests->fetch()) { 00025 // Calls notificationssettings/digest 00026 $cmd = CommandsFactory::create_command(clone($possible_digests), 'digest', false); 00027 $ret->merge($cmd->execute()); 00028 } 00029 00030 return $ret; 00031 } 00032 }