本文整理汇总了PHP中self::setResult方法的典型用法代码示例。如果您正苦于以下问题:PHP self::setResult方法的具体用法?PHP self::setResult怎么用?PHP self::setResult使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类self
的用法示例。
在下文中一共展示了self::setResult方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fromArray
/**
* {@inheritdoc}
*/
public static function fromArray(array $values)
{
$message = new self();
$values = array_merge(['result' => null, 'battle_start_timestamp_ms' => null, 'battle_end_timestamp_ms' => null, 'battle_id' => null, 'defender' => null, 'battle_log' => null, 'attacker' => null], $values);
$message->setResult($values['result']);
$message->setBattleStartTimestampMs($values['battle_start_timestamp_ms']);
$message->setBattleEndTimestampMs($values['battle_end_timestamp_ms']);
$message->setBattleId($values['battle_id']);
$message->setDefender($values['defender']);
$message->setBattleLog($values['battle_log']);
$message->setAttacker($values['attacker']);
return $message;
}
示例2: fromArray
/**
* {@inheritdoc}
*/
public static function fromArray(array $values)
{
$message = new self();
$values = array_merge(['result' => null, 'items_awarded' => [], 'items_unlocked' => []], $values);
$message->setResult($values['result']);
foreach ($values['items_awarded'] as $item) {
$message->addItemsAwarded($item);
}
foreach ($values['items_unlocked'] as $item) {
$message->addItemsUnlocked($item);
}
return $message;
}
示例3: fromArray
/**
* {@inheritdoc}
*/
public static function fromArray(array $values)
{
$message = new self();
$values = array_merge(['result' => null, 'pokemon_data' => null, 'capture_probability' => null], $values);
$message->setResult($values['result']);
$message->setPokemonData($values['pokemon_data']);
$message->setCaptureProbability($values['capture_probability']);
return $message;
}
示例4: fromArray
/**
* {@inheritdoc}
*/
public static function fromArray(array $values)
{
$message = new self();
$values = array_merge(['result' => null, 'currency_type' => [], 'currency_awarded' => [], 'defenders_count' => null], $values);
$message->setResult($values['result']);
$message->setDefendersCount($values['defenders_count']);
foreach ($values['currency_type'] as $item) {
$message->addCurrencyType($item);
}
foreach ($values['currency_awarded'] as $item) {
$message->addCurrencyAwarded($item);
}
return $message;
}
示例5: fromArray
/**
* {@inheritdoc}
*/
public static function fromArray(array $values)
{
$message = new self();
$values = array_merge(['result' => null, 'pokemon_id' => null, 'combat_points' => null, 'pokemon_data_id' => null], $values);
$message->setResult($values['result']);
$message->setPokemonId($values['pokemon_id']);
$message->setCombatPoints($values['combat_points']);
$message->setPokemonDataId($values['pokemon_data_id']);
return $message;
}
示例6: fromArray
/**
* {@inheritdoc}
*/
public static function fromArray(array $values)
{
$message = new self();
$values = array_merge(['result' => null, 'pokemon_id' => null, 'amount' => null], $values);
$message->setResult($values['result']);
$message->setPokemonId($values['pokemon_id']);
$message->setAmount($values['amount']);
return $message;
}
示例7: fromArray
/**
* {@inheritdoc}
*/
public static function fromArray(array $values)
{
$message = new self();
$values = array_merge(['result' => null, 'start_time' => null, 'badges' => []], $values);
$message->setResult($values['result']);
$message->setStartTime($values['start_time']);
foreach ($values['badges'] as $item) {
$message->addBadges($item);
}
return $message;
}
示例8: fromArray
/**
* {@inheritdoc}
*/
public static function fromArray(array $values)
{
$message = new self();
$values = array_merge(['result' => null, 'fort_details' => null, 'pokemon_data' => null, 'gym_state' => null], $values);
$message->setResult($values['result']);
$message->setFortDetails($values['fort_details']);
$message->setPokemonData($values['pokemon_data']);
$message->setGymState($values['gym_state']);
return $message;
}
示例9: fromArray
/**
* {@inheritdoc}
*/
public static function fromArray(array $values)
{
$message = new self();
$values = array_merge(['gym_state' => null, 'name' => null, 'urls' => [], 'result' => null, 'description' => null], $values);
$message->setGymState($values['gym_state']);
$message->setName($values['name']);
$message->setResult($values['result']);
$message->setDescription($values['description']);
foreach ($values['urls'] as $item) {
$message->addUrls($item);
}
return $message;
}
示例10: fromArray
/**
* @param array $data
* @throws Exception
* @return self
*/
public static function fromArray($data)
{
if (empty($data['jsonrpc'])) {
throw new Exception('Response is not valid JsonRPC response: missing protocol version');
}
if ($data['jsonrpc'] != Request::VERSION) {
throw new Exception('Response is not valid JsonRPC response: invalid protocol version');
}
$response = new self();
if (!empty($data['error'])) {
$response->setError(static::getErrorObject($data['error']));
} else {
if (empty($data['result'])) {
throw new Exception('Response is not valid JsonRPC response: missing result');
}
$response->setResult($data['result']);
}
if (empty($data['id'])) {
throw new Exception('Response is not valid JsonRPC response: missing id');
}
$response->setId($data['id']);
return $response;
}
示例11: fromArray
/**
* {@inheritdoc}
*/
public static function fromArray(array $values)
{
$message = new self();
$values = array_merge(['result' => null, 'item_templates_timestamp_ms' => null, 'asset_digest_timestamp_ms' => null], $values);
$message->setResult($values['result']);
$message->setItemTemplatesTimestampMs($values['item_templates_timestamp_ms']);
$message->setAssetDigestTimestampMs($values['asset_digest_timestamp_ms']);
return $message;
}
示例12: fromArray
/**
* {@inheritdoc}
*/
public static function fromArray(array $values)
{
$message = new self();
$values = array_merge(['result' => null, 'battle_log' => null, 'battle_id' => null, 'active_defender' => null, 'active_attacker' => null], $values);
$message->setResult($values['result']);
$message->setBattleLog($values['battle_log']);
$message->setBattleId($values['battle_id']);
$message->setActiveDefender($values['active_defender']);
$message->setActiveAttacker($values['active_attacker']);
return $message;
}
示例13: fromArray
/**
* {@inheritdoc}
*/
public static function fromArray(array $values)
{
$message = new self();
$values = array_merge(['result' => null, 'fort_id' => null, 'items' => [], 'eggs' => null], $values);
$message->setResult($values['result']);
$message->setFortId($values['fort_id']);
$message->setEggs($values['eggs']);
foreach ($values['items'] as $item) {
$message->addItems($item);
}
return $message;
}
示例14: fromArray
/**
* {@inheritdoc}
*/
public static function fromArray(array $values)
{
$message = new self();
$values = array_merge(['result' => null, 'evolved_pokemon_data' => null, 'experience_awarded' => null, 'candy_awarded' => null], $values);
$message->setResult($values['result']);
$message->setEvolvedPokemonData($values['evolved_pokemon_data']);
$message->setExperienceAwarded($values['experience_awarded']);
$message->setCandyAwarded($values['candy_awarded']);
return $message;
}
示例15: fromArray
/**
* {@inheritdoc}
*/
public static function fromArray(array $values)
{
$message = new self();
$values = array_merge(['result' => null, 'log_entries' => []], $values);
$message->setResult($values['result']);
foreach ($values['log_entries'] as $item) {
$message->addLogEntries($item);
}
return $message;
}