本文整理汇总了PHP中SugarBean::get_notification_recipients方法的典型用法代码示例。如果您正苦于以下问题:PHP SugarBean::get_notification_recipients方法的具体用法?PHP SugarBean::get_notification_recipients怎么用?PHP SugarBean::get_notification_recipients使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SugarBean
的用法示例。
在下文中一共展示了SugarBean::get_notification_recipients方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
function get_notification_recipients() {
if($this->special_notification) {
return parent::get_notification_recipients();
}
// $GLOBALS['log']->debug('Call.php->get_notification_recipients():'.print_r($this,true));
$list = array();
if(!is_array($this->contacts_arr)) {
$this->contacts_arr = array();
}
if(!is_array($this->users_arr)) {
$this->users_arr = array();
}
if(!is_array($this->leads_arr)) {
$this->leads_arr = array();
}
foreach($this->users_arr as $user_id) {
$notify_user = new User();
$notify_user->retrieve($user_id);
$notify_user->new_assigned_user_name = $notify_user->full_name;
$GLOBALS['log']->info("Notifications: recipient is $notify_user->new_assigned_user_name");
$list[$notify_user->id] = $notify_user;
}
foreach($this->contacts_arr as $contact_id) {
$notify_user = new Contact();
$notify_user->retrieve($contact_id);
$notify_user->new_assigned_user_name = $notify_user->full_name;
$GLOBALS['log']->info("Notifications: recipient is $notify_user->new_assigned_user_name");
$list[$notify_user->id] = $notify_user;
}
foreach($this->leads_arr as $lead_id) {
$notify_user = new Lead();
$notify_user->retrieve($lead_id);
$notify_user->new_assigned_user_name = $notify_user->full_name;
$GLOBALS['log']->info("Notifications: recipient is $notify_user->new_assigned_user_name");
$list[$notify_user->id] = $notify_user;
}
global $sugar_config;
if(isset($sugar_config['disable_notify_current_user']) && $sugar_config['disable_notify_current_user']) {
global $current_user;
if(isset($list[$current_user->id]))
unset($list[$current_user->id]);
}
// $GLOBALS['log']->debug('Call.php->get_notification_recipients():'.print_r($list,true));
return $list;
}
示例2: get_notification_recipients
protected function get_notification_recipients()
{
if ($this->special_notification) {
return parent::get_notification_recipients();
}
$list = [];
if (!is_array($this->contacts_arr)) {
$this->contacts_arr = [];
}
if (!is_array($this->users_arr)) {
$this->users_arr = [];
}
if (!is_array($this->leads_arr)) {
$this->leads_arr = [];
}
foreach ($this->users_arr as $user_id) {
$notify_user = new User();
$notify_user->retrieve($user_id);
$notify_user->new_assigned_user_name = $notify_user->full_name;
Log::info("Notifications: recipient is {$notify_user->new_assigned_user_name}");
$list[$notify_user->id] = $notify_user;
}
foreach ($this->contacts_arr as $contact_id) {
$notify_user = new Contact();
$notify_user->retrieve($contact_id);
$notify_user->new_assigned_user_name = $notify_user->full_name;
Log::info("Notifications: recipient is {$notify_user->new_assigned_user_name}");
$list[$notify_user->id] = $notify_user;
}
foreach ($this->leads_arr as $lead_id) {
$notify_user = new Lead();
$notify_user->retrieve($lead_id);
$notify_user->new_assigned_user_name = $notify_user->full_name;
Log::info("Notifications: recipient is {$notify_user->new_assigned_user_name}");
$list[$notify_user->id] = $notify_user;
}
global $sugar_config;
if (isset($sugar_config['disable_notify_current_user']) && $sugar_config['disable_notify_current_user']) {
global $current_user;
if (isset($list[$current_user->id])) {
unset($list[$current_user->id]);
}
}
return $list;
}
示例3: array
function get_notification_recipients()
{
if ($this->special_notification) {
return parent::get_notification_recipients();
}
// $GLOBALS['log']->debug('Call.php->get_notification_recipients():'.print_r($this,true));
$list = array();
if (!is_array($this->contacts_arr)) {
$this->contacts_arr = array();
}
if (empty($this->contacts_arr) && $this->load_relationship('contacts')) {
$this->contacts_arr = $this->contacts->get();
}
if (!is_array($this->users_arr)) {
$this->users_arr = array();
}
if (empty($this->users_arr) && $this->load_relationship('users')) {
$this->users_arr = $this->users->get();
}
if (!is_array($this->leads_arr)) {
$this->leads_arr = array();
}
if (empty($this->leads_arr) && $this->load_relationship('leads')) {
$this->leads_arr = $this->leads->get();
}
foreach ($this->users_arr as $user_id) {
$notify_user = BeanFactory::getBean('Users', $user_id);
if (!empty($notify_user->id)) {
$notify_user->new_assigned_user_name = $notify_user->full_name;
$GLOBALS['log']->info("Notifications: recipient is {$notify_user->new_assigned_user_name}");
$list[$notify_user->id] = $notify_user;
}
}
foreach ($this->contacts_arr as $contact_id) {
$notify_user = BeanFactory::getBean('Contacts', $contact_id);
if (!empty($notify_user->id) && !empty($notify_user->email1)) {
$notify_user->new_assigned_user_name = $notify_user->full_name;
$GLOBALS['log']->info("Notifications: recipient is {$notify_user->new_assigned_user_name}");
$list[$notify_user->id] = $notify_user;
}
}
foreach ($this->leads_arr as $lead_id) {
$notify_user = BeanFactory::getBean('Leads', $lead_id);
if (!empty($notify_user->id)) {
$notify_user->new_assigned_user_name = $notify_user->full_name;
$GLOBALS['log']->info("Notifications: recipient is {$notify_user->new_assigned_user_name}");
$list[$notify_user->id] = $notify_user;
}
}
// $GLOBALS['log']->debug('Call.php->get_notification_recipients():'.print_r($list,true));
return $list;
}
示例4: array
function get_notification_recipients()
{
if ($this->special_notification) {
return parent::get_notification_recipients();
}
$list = array();
if (!is_array($this->contacts_arr)) {
$this->contacts_arr = array();
}
if (!is_array($this->users_arr)) {
$this->users_arr = array();
}
if (!is_array($this->leads_arr)) {
$this->leads_arr = array();
}
foreach ($this->users_arr as $user_id) {
$notify_user = new User();
$notify_user->retrieve($user_id);
$notify_user->new_assigned_user_name = $notify_user->full_name;
$GLOBALS['log']->info("Notifications: recipient is {$notify_user->new_assigned_user_name}");
$list[$notify_user->id] = $notify_user;
}
foreach ($this->contacts_arr as $contact_id) {
$notify_user = new Contact();
$notify_user->retrieve($contact_id);
$notify_user->new_assigned_user_name = $notify_user->full_name;
$GLOBALS['log']->info("Notifications: recipient is {$notify_user->new_assigned_user_name}");
$list[$notify_user->id] = $notify_user;
}
foreach ($this->leads_arr as $lead_id) {
$notify_user = new Lead();
$notify_user->retrieve($lead_id);
$notify_user->new_assigned_user_name = $notify_user->full_name;
$GLOBALS['log']->info("Notifications: recipient is {$notify_user->new_assigned_user_name}");
$list[$notify_user->id] = $notify_user;
}
return $list;
}