當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。