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


PHP Player::arrayIdToModel方法代码示例

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


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

示例1: unserialize

 /**
  * {@inheritDoc}
  */
 public function unserialize($data)
 {
     $data = unserialize($data);
     $group = \Group::get($data['group']);
     $players = \Player::arrayIdToModel($data['players']);
     $teams = \Team::arrayIdToModel($data['teams']);
     $this->__construct($group, array_merge($players, $teams));
 }
开发者ID:bchhun,项目名称:bzion,代码行数:11,代码来源:GroupJoinEvent.php

示例2: unserialize

 /**
  * {@inheritdoc}
  */
 public function unserialize($data)
 {
     $data = unserialize($data);
     $conversation = \Conversation::get($data['conversation']);
     $players = \Player::arrayIdToModel($data['players']);
     $teams = \Team::arrayIdToModel($data['teams']);
     $this->__construct($conversation, array_merge($players, $teams));
 }
开发者ID:blast007,项目名称:bzion,代码行数:11,代码来源:ConversationJoinEvent.php

示例3: getMissingTeamMembers

 /**
  * Get the members of one of the conversation's teams that don't belong in
  * the conversation
  *
  * @todo   Use Model::createFromDatabaseResults()
  * @param  Team $team The team to check
  * @return Player[]
  */
 public function getMissingTeamMembers(Team $team)
 {
     $query = "SELECT players.id AS id FROM players\n            WHERE players.team = ?\n            AND players.id NOT IN (\n              SELECT player_conversations.player FROM player_conversations\n              WHERE player_conversations.conversation = ?\n            )";
     $results = $this->db->query($query, array($team->getId(), $this->id));
     return Player::arrayIdToModel(array_column($results, 'id'));
 }
开发者ID:allejo,项目名称:bzion,代码行数:14,代码来源:Conversation.php

示例4: getMembers

 /**
  * Get a list containing each member of the group
  * @param  int|null $hide The ID of a player to ignore
  * @return Model[]  An array of players and teams
  */
 public function getMembers($hide = null)
 {
     $members = Player::arrayIdToModel($this->getPlayerIds($hide, true));
     usort($members, Player::getAlphabeticalSort());
     $teams = Team::arrayIdToModel($this->getTeamIds());
     usort($teams, Team::getAlphabeticalSort());
     return array_merge($members, $teams);
 }
开发者ID:kleitz,项目名称:bzion,代码行数:13,代码来源:Group.php

示例5: parsePlayers

 /**
  * Get an array of players based on a string representation
  * @param string $playerString
  * @return Player[]|null Returns null if there were no players recorded for this match
  */
 private function parsePlayers($playerString)
 {
     if ($playerString == null) {
         return null;
     }
     return Player::arrayIdToModel(explode(",", $playerString));
 }
开发者ID:allejo,项目名称:bzion,代码行数:12,代码来源:Match.php

示例6: getUsers

 /**
  * Get an array of players who have this role assigned to them
  *
  * @return Player[] An array of players with this role assigned to them
  */
 public function getUsers()
 {
     return Player::arrayIdToModel(parent::fetchIds("JOIN player_roles ON player_roles.role_id = roles.id WHERE player_roles.role_id = ?", "i", array($this->getId()), "roles", "player_roles.user_id"));
 }
开发者ID:blast007,项目名称:bzion,代码行数:9,代码来源:Role.php


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