本文整理汇总了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"));
}