Example #1
0
 public function getCharacterID($characterName)
 {
     /** Leading in PhealNG with blank keys */
     $pheal = new Pheal('', '', 'eve');
     try {
         /** Verifying the CCP API server is functioning */
         if ($this->_ccpAPIStatus) {
             /** Pulling the CharacterAffiliation */
             $response = $pheal->CharacterID(array('names' => $characterName));
             /** Working through the pheal response*/
             if (is_object($response->characters)) {
                 /** Returning the character information */
                 return $response->characters[0];
             } else {
                 /** Returning null to indicate that the characterID doesn't exist */
                 return null;
             }
         } else {
             /** Returning false to indicate that the API server has issues */
             return false;
         }
     } catch (\Pheal\Exceptions\PhealException $e) {
         get_class($e);
         $_SESSION['alert'] = new Alert('warning', $e->getMessage());
     }
 }