當前位置: 首頁>>代碼示例>>PHP>>正文


PHP self::setResult方法代碼示例

本文整理匯總了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;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:16,代碼來源:StartGymBattleResponse.php

示例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;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:16,代碼來源:LevelUpRewardsResponse.php

示例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;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:12,代碼來源:IncenseEncounterResponse.php

示例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;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:17,代碼來源:CollectDailyDefenderBonusResponse.php

示例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;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:13,代碼來源:CatchPokemonLogEntry.php

示例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;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:12,代碼來源:BuddyPokemonLogEntry.php

示例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;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:14,代碼來源:GetPlayerProfileResponse.php

示例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;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:13,代碼來源:FortDeployPokemonResponse.php

示例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;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:16,代碼來源:GetGymDetailsResponse.php

示例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;
 }
開發者ID:moaction,項目名稱:jsonrpc-common,代碼行數:28,代碼來源:Response.php

示例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;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:12,代碼來源:DownloadRemoteConfigVersionResponse.php

示例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;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:14,代碼來源:AttackGymResponse.php

示例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;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:15,代碼來源:FortSearchLogEntry.php

示例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;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:13,代碼來源:EvolvePokemonResponse.php

示例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;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:13,代碼來源:SfidaActionLogResponse.php


注:本文中的self::setResult方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。