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


PHP CategoryPeer::getForExpertCategoryUserId方法代码示例

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


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

示例1: sendBestResponseMessage

    private function sendBestResponseMessage($post)
    {
        $user = UserPeer::retrieveByPK($post->getPosterId());
        $thread = ThreadPeer::retrieveByPK($post->getThreadId());
        $cats = CategoryPeer::getForExpertCategoryUserId($user->getId());
        $cat_tab = array();
        foreach ($cats as $cat) {
            $cat_tab[] = $cat->getName();
        }
        $cat_list = join(', ', $cat_tab);
        if ($user->getType() == UserPeer::getTypeFromValue('expert')) {
            $subject = 'Best Response Selected';
            $body = 'Hi ' . $user->getName() . ',<br><br>
          Your reply to the question, "' . $thread->getTitle() . '" on the question boards, was just selected as the best response.<br><br>
		  Rayku SYS';
            //Grab the user object
            $currentuser = UserPeer::retrieveByPK($this->getUser()->getRaykuUserId());
            //Send the messages
            $currentuser->sendMessage($user->getId(), $subject, $body);
        } else {
            $subject = 'Best Response Selected';
            $body = 'Hi ' . $user->getName() . ',<br><br>
          Congratulations! Your reply to the question, "' . $thread->getTitle() . '" on the question boards, was just selected as the best response.<br><br>
          Your expert score has been increased accordingly.<br><br>
		  Thanks!<br>
		  Rayku SYS';
            //Grab the user object
            $currentuser = UserPeer::retrieveByPK($this->getUser()->getRaykuUserId());
            //Send the messages
            $currentuser->sendMessage($user->getId(), $subject, $body);
        }
        $sub1 = 'You have selected an Expert Best Response';
        $body1 = 'Hi ' . $this->getUser()->getRaykuUser()->getName() . ',<br><br>
      Thank you for selecting a best response for your question. The author of the response is ' . $user->getName() . ', who is an expert in the following subjects: <br>
	  ' . $cat_list . '<br><br>
      ' . $user->getName() . ' has been teaching avid learners with Rayku since ' . $user->getCreatedAt('Y-m-d') . '. Take a look at the following link, for information on spending an 1-on-1 session with ' . $user->getName() . ':<br><br>
	  <a href="' . sfConfig::get('app_rayku_url') . '/expertmanager/portfolio/' . $user->getUsername() . '">http://www.rayku.com/expertmanager/portfolio/' . $user->getUsername() . '</a><br><br>
	  Rayku SYS';
        //Grab the user object
        $expertuser = UserPeer::retrieveByPK($user->getId());
        //Send the messages
        $expertuser->sendMessage($this->getUser()->getRaykuUserId(), $sub1, $body1);
    }
开发者ID:rayku,项目名称:rayku,代码行数:43,代码来源:actions.class.php


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