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


PHP Member::setName方法代码示例

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


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

示例1: execute

  protected function execute($arguments = array(), $options = array())
  {
    $databaseManager = new sfDatabaseManager($this->configuration);

    $n = (int)$options['number'];
    $link = $options['link'];
    if (!is_null($link))
    {
      $linkMember = Doctrine::getTable('Member')->find($link);
      if (!$linkMember)
      {
        throw new Exception("not found member: ".$link);
      }
    }

    for ($i = 0; $i < $n; $i++)
    {
      $member = new Member();
      $member->setName('dummy');
      $member->setIsActive(self::fetchRandomNotActive($options['notactivemember-rate'], $n));
      $member->save();

      $member->setName(sprintf($options['name-format'], $member->getId()));
      $member->save();

      $address = sprintf($options['mail-address-format'], $member->getId());
      $member->setConfig('pc_address', $address);
      $member->setConfig('mobile_address', $address);

      $password = preg_replace("/%d/", $member->getId(), $options['password-format'], 1);
      $member->setConfig('password', md5($password));

      $this->logSection('member+', $member->getName());
      if (isset($linkMember))
      {
        $memberRelationship1 = new MemberRelationship();
        $memberRelationship1->setMember($member);
        $memberRelationship1->setMemberRelatedByMemberIdFrom($linkMember);
        $memberRelationship1->setIsFriend(true);
        $memberRelationship1->save();

        $memberRelationship2 = new MemberRelationship();
        $memberRelationship2->setMember($linkMember);
        $memberRelationship2->setMemberRelatedByMemberIdFrom($member);
        $memberRelationship2->setIsFriend(true);
        $memberRelationship2->save();
        $this->logSection('friend link', sprintf("%s - %s", $linkMember->getId(), $member->getId()));
      }
    }
  }
开发者ID:nise-nabe,项目名称:opKdtPlugin,代码行数:50,代码来源:opKdtGenerateMemberTask.class.php

示例2: addMember

 private function addMember($id, $name)
 {
     $session = $this->getSession($id);
     // Check for existing member
     foreach ($session->getMembers() as $candidate) {
         if ($candidate->getName() == $name) {
             $member = $candidate;
             break;
         }
     }
     // Create new member
     if (!isset($member)) {
         $member = new Member();
         $member->setName($name);
         $member->setSession($session);
         $this->save($member);
     }
     // Store name in cookie if not done yet
     if (!isset($_COOKIE['scrum_member_name'])) {
         setcookie('scrum_member_name', $name);
     }
     $result = new stdClass();
     $result->sessionId = $id;
     $result->memberId = $member->getId();
     return $result;
 }
开发者ID:rakesh-mohanta,项目名称:scrumonline,代码行数:26,代码来源:session-controller.php

示例3: executeTransaction

 protected function executeTransaction($conn, $arguments = array(), $options = array())
 {
     $n = (int) $options['number'];
     $link = $options['link'];
     if (null !== $link) {
         $linkMember = Doctrine::getTable('Member')->find($link);
         if (!$linkMember) {
             throw new Exception("not found member: " . $link);
         }
     }
     for ($i = 0; $i < $n; $i++) {
         $member = new Member();
         $member->setName('dummy');
         $member->setIsActive(true);
         $member->save();
         $member->setName(sprintf($options['name-format'], $member->getId()));
         $member->save();
         $address = sprintf($options['mail-address-format'], $member->getId());
         self::setMemberConfig($member->id, 'pc_address', $address);
         self::setMemberConfig($member->id, 'mobile_address', $address);
         $password = preg_replace("/%d/", $member->getId(), $options['password-format'], 1);
         self::setMemberConfig($member->id, 'password', md5($password));
         $this->logSection('member+', $member->getName());
         if (isset($linkMember)) {
             $memberRelationship1 = new MemberRelationship();
             $memberRelationship1->setMemberIdTo($member->id);
             $memberRelationship1->setMemberIdFrom($linkMember->id);
             $memberRelationship1->setIsFriend(true);
             $memberRelationship1->save();
             $memberRelationship1->free(true);
             $memberRelationship2 = new MemberRelationship();
             $memberRelationship2->setMemberIdTo($linkMember->id);
             $memberRelationship2->setMemberIdFrom($member->id);
             $memberRelationship2->setIsFriend(true);
             $memberRelationship2->save();
             $memberRelationship2->free(true);
             $this->logSection('friend link', sprintf("%s - %s", $linkMember->getId(), $member->getId()));
         }
         $member->free(true);
     }
 }
开发者ID:kawahara,项目名称:opKdtPlugin,代码行数:41,代码来源:opKdtGenerateMemberTask.class.php

示例4: createCluster

  private function createCluster($memberNum)
  {
    $memberIds = array();  
    for($i = 0; $i < $memberNum; ++$i)
    {
      $member = new Member();
      $member->setName('dummy');
      $member->setIsActive(true);
      $member->save();       
  
      $memberIds[] = $member->getId();
   
      $member->setName(sprintf('dummy%d', $member->getId()));
      $member->save();       
    
      $address = sprintf('sns%d@example.com', $member->getId());

      $this->setMemberConfig($member->getId(), 'pc_address', $address);
      $this->setMemberConfig($member->getId(), 'mobile_address', $address);

      $password = 'password';
      $this->setMemberConfig($member->getId(), 'password', md5($password));
      $member->free(true);
    }
    for($i = 0; $i < $memberNum; ++$i)
    {
      for($j = $i + 1; $j < $memberNum; ++$j) 
      {
        if ($i === $j) continue;
        $relation = new MemberRelationship();
        $relation->setMemberIdFrom($memberIds[$i]);
        $relation->setMemberIdTo($memberIds[$j]);
        $relation->setFriend(true);
        $relation->save();     
        $relation->free(true); 
      }
    }
  }
开发者ID:nise-nabe,项目名称:opKdtPlugin,代码行数:38,代码来源:opKdtGenerateFriendClusterTask.class.php

示例5: core_dim_add_company_to_users_dimension

function core_dim_add_company_to_users_dimension($object, $user_dim, $company_ot)
{
    $member = new Member();
    $member->setName($object->getObjectName());
    $member->setObjectTypeId($company_ot->getId());
    $member->setDimensionId($user_dim->getId());
    $member->setDepth(1);
    $member->setParentMemberId(0);
    $member->setObjectId($object->getId());
    $member->save();
    // permisssions
    $sql = "INSERT INTO `" . TABLE_PREFIX . "contact_dimension_permissions` (`permission_group_id`, `dimension_id`, `permission_type`)\n\t\t\t SELECT `c`.`permission_group_id`, " . $user_dim->getId() . ", 'check'\n\t\t\t FROM `" . TABLE_PREFIX . "contacts` `c` \n\t\t\t WHERE `c`.`is_company`=0 AND `c`.`user_type`!=0 AND `c`.`disabled`=0\n\t\t\t ON DUPLICATE KEY UPDATE `dimension_id`=`dimension_id`;";
    DB::execute($sql);
    $sql = "INSERT INTO `" . TABLE_PREFIX . "contact_member_permissions` (`permission_group_id`, `member_id`, `object_type_id`, `can_write`, `can_delete`)\n\t\t\t SELECT `c`.`permission_group_id`, " . $member->getId() . ", `ot`.`id`, (`c`.`object_id` = " . $object->getId() . ") as `can_write`, (`c`.`object_id` = " . $object->getId() . ") as `can_delete`\n\t\t\t FROM `" . TABLE_PREFIX . "contacts` `c` JOIN `" . TABLE_PREFIX . "object_types` `ot` \n\t\t\t WHERE `c`.`is_company`=0 \n\t\t\t \tAND `c`.`user_type`!=0 AND `c`.`disabled`=0\n\t\t\t\tAND `ot`.`type` IN ('content_object', 'comment')\n\t\t\t ON DUPLICATE KEY UPDATE `member_id`=`member_id`;";
    DB::execute($sql);
    return $member;
}
开发者ID:rorteg,项目名称:fengoffice,代码行数:17,代码来源:core_dimensions_hooks.php

示例6: getMessage

        return $this->status_description;
    }
    //Get message
    public function getMessage()
    {
        return $this->message;
    }
}
//Join status
$sql = "SELECT * FROM users\n\t\t\tINNER JOIN status \n\t\t\tON user_id = fk_user_id \n\t\t\tINNER JOIN descriptions \n\t\t\tON fk_description_id = description_id\n\t\t\tINNER JOIN messages\n\t\t\tON message_id = fk_message_id";
$member_list = array();
if ($query = mysqli_query($dbc, $sql)) {
    while ($row = mysqli_fetch_assoc($query)) {
        $member = new Member();
        $member->setId($row["user_id"]);
        $member->setName($row["user_name"]);
        $member->setImage($row["user_img"]);
        $member->setStatusId($row["fk_description_id"]);
        $member->setStatusDescription($row["description_text"]);
        $member->setMessage($row["message_text"]);
        array_push($member_list, $member);
    }
}
?>
<!DOCTYPE HTML>
<html>
    <head>
        <meta charset="utf-8">
    	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    	<meta name="viewport" content="width=device-width, initial-scale=1">
    	<meta name="theme-color" content="#2D78BB">
开发者ID:T-RexZ,项目名称:pokedex,代码行数:31,代码来源:members.php


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