当前位置: 首页>>代码示例>>PHP>>正文


PHP Doctrine_Collection::getTitle方法代码示例

本文整理汇总了PHP中Doctrine_Collection::getTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP Doctrine_Collection::getTitle方法的具体用法?PHP Doctrine_Collection::getTitle怎么用?PHP Doctrine_Collection::getTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Doctrine_Collection的用法示例。


在下文中一共展示了Doctrine_Collection::getTitle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: notifyAudience

 /**
  * Send email to audience, and if requested copy to sender
  *
  * @param Doctrine_Collection $object
  * @param Array $form_values
  */
 protected function notifyAudience($object, $form_values, $route_name)
 {
     $user = $this->getUser();
     $signed_in = $user->isAuthenticated() ? true : false;
     $from_email = $form_values['from_email'];
     $to_email = $this->getRecipients($form_values['to_email']);
     // Variables
     $vars = array('object' => $object);
     $vars['form_values'] = $form_values;
     $vars['route_name'] = $route_name;
     if ($signed_in) {
         $vars['from_text'] = sprintf('%s %s (%s)', $user->getGuardUser()->getFirstName(), $user->getGuardUser()->getLastName(), $user->getGuardUser()->getEmailAddress());
     } else {
         $vars['from_text'] = sprintf('%s (%s)', $form_values['from_name'], $form_values['from_email']);
     }
     $vars['name'] = $object->getTitle() ? $object->getTitle() : __('Item Page');
     // Email templates
     $message_html = $this->getPartial('rtSocial/email_html', $vars);
     $message_html = $this->getPartial('rtEmail/layout_html', array('content' => $message_html));
     $message_plain = $this->getPartial('rtSocial/email_plain', $vars);
     $message_plain = $this->getPartial('rtEmail/layout_plain', array('content' => html_entity_decode($message_plain)));
     // Subject
     $subject_text = 'I thought you might be interested in this';
     $subject = $object->getTitle() ? sprintf('%s: %s', $subject_text, $object->getTitle()) : $subject_text . '...';
     // Email
     $message = Swift_Message::newInstance()->setFrom($from_email)->setTo($to_email)->setSubject($subject)->setBody($message_html, 'text/html')->addPart($message_plain, 'text/plain');
     // Send copy to sender
     if ($form_values['copy'] == true) {
         $message->setBcc($from_email);
     }
     $this->getMailer()->send($message);
 }
开发者ID:pierswarmers,项目名称:rtCorePlugin,代码行数:38,代码来源:BasertSocialActions.class.php


注:本文中的Doctrine_Collection::getTitle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。