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


PHP UserPeer::getTypeFromValue方法代码示例

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


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

示例1: getRequestedUserType

 private function getRequestedUserType()
 {
     $allowedTypes = array(UserPeer::getTypeFromValue('user'), UserPeer::getTypeFromValue('expert'));
     $requestedType = $this->getRequestParameter('utype');
     if (in_array($requestedType, $allowedTypes)) {
         return $requestedType;
     }
     return UserPeer::getTypeFromValue('user');
 }
开发者ID:rayku,项目名称:rayku,代码行数:9,代码来源:actions.class.php

示例2: 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

示例3: category

?>
 </div>
          <div style="font-weight:normal;color:#666;width:200px;margin-left:240px;">6 characters or more</div>
          <div class="spacer"></div>
        </div>
      </div>
      <div class="bottom"></div>
      <div class="spacer"></div>
    </div>
    <?php 
//include_partial('registerCreditCard');
//include_partial('registerRefferal');
?>
    <!-- for expert categories //-->
    <?php 
if ($requestedUserType == UserPeer::getTypeFromValue('expert')) {
    ?>
    <div class="box">
      <div class="top"></div>
      <div class="content">
        <div class="title">Select Expert Categories</div>
        <div class="subtitle">Every expert needs to select atleast one category (You may select multiple categories using the shift button)</div>
        <div class="entry">
          <div class="ttle">Categories</div>
          <div style="clear:left;">
            <?php 
    $options = array();
    ?>
            <?php 
    $categories = CategoryPeer::getAll();
    ?>
开发者ID:rayku,项目名称:rayku,代码行数:31,代码来源:indexSuccess.php

示例4: setUserTypeCredentials

 protected function setUserTypeCredentials($userType)
 {
     $credentials = array();
     switch ($userType) {
         case UserPeer::getTypeFromValue('admin'):
             $credentials[] = 'admin';
             break;
         case UserPeer::getTypeFromValue('expert'):
             $credentials[] = 'expert';
             break;
         case UserPeer::getTypeFromValue('user'):
             $credentials[] = 'student';
             break;
     }
     $this->clearCredentials();
     $this->addCredentials($credentials);
 }
开发者ID:rayku,项目名称:rayku,代码行数:17,代码来源:SiteUser.class.php


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