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


PHP Conversation::filterColumns方法代码示例

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


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

示例1: createAction

 public function createAction()
 {
     $this->logger->entering();
     $this->logger->info('Creating a new messsage row');
     $messages = new Message();
     $message = $messages->fetchNew();
     $this->logger->info('Setting message from post parameters');
     $messageParams = $messages->filterColumns($this->_getParam('message'));
     $message->setFromArray($messageParams);
     $date = new Zend_Date();
     $message->created_on = $date->get(Zend_Date::ISO_8601);
     $this->logger->info('Creating a new conversation if necessary');
     if (empty($message->conversation_id)) {
         $conversations = new Conversation();
         $conversation = $conversations->fetchNew();
         $conversationParams = $conversations->filterColumns($this->_getParam('conversation'));
         $conversation->setfromArray($conversationParams);
         $conversation->save();
         $message->conversation_id = $conversation->id;
     }
     $this->logger->info('Saving the message');
     $message->save();
     $item = $conversation->findParentItem();
     $owner = $item->findParentUser();
     $asker = $conversation->findParentUser();
     $mail = new Zend_Mail();
     $mail->setFrom('swaplady@example.com', 'Swaplady');
     $mail->addTo($owner->email, $owner->name);
     $mail->setSubject("[Swaplady] New message about {$item->name}");
     $mail->setBodyText($message->body . "\nYou can add to the conversation at http://swaplady.com/conversations/show/{$conversation->id}");
     $mail->send();
     $mail = new Zend_Mail();
     $mail->setFrom('swaplady@example.com', 'Swaplady');
     $mail->addTo($asker->email, $asker->name);
     $mail->setSubject("[Swaplady] New message about {$item->name}");
     $mail->setBodyText($message->body . "\nYou can add to the conversation at http://swaplady.com/conversations/show/{$conversation->id}");
     $mail->send();
     $this->logger->info('Redirecting to show the item of the message');
     $this->_redirect('/conversations/show/' . $message->conversation_id);
 }
开发者ID:josephholsten,项目名称:swaplady,代码行数:40,代码来源:MessageController.php


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