本文整理匯總了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));
}
示例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));
}
示例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'));
}
示例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);
}
示例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));
}
示例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"));
}