Esempio n. 1
0
 /**
  * @param stdClass $result
  */
 public function loadResult(stdClass $result)
 {
     parent::loadResult($result);
     if (isset($result->thumb)) {
         $this->thumb = new PhotoSize($result->thumb);
     }
 }
Esempio n. 2
0
 public function loadResult(stdClass $result)
 {
     parent::loadResult($result);
     if (isset($result->message)) {
         $this->message = new Message($result->message);
     }
 }
Esempio n. 3
0
 /**
  * @param array $attributes
  */
 public function loadRelated(array $attributes)
 {
     parent::loadRelated($attributes);
     if (isset($attributes['from'])) {
         $this->from = User::create($attributes['from']);
     }
     if (isset($attributes['location'])) {
         $this->location = Location::create($attributes['location']);
     }
 }
 /**
  * @param stdClass $result
  */
 public function loadResult(stdClass $result)
 {
     parent::loadResult($result);
     $this->photos = [];
     if ($result->total_count > 0) {
         $this->photos = array_map(function ($photo) {
             return new PhotoSize($photo);
         }, $result->photos[0]);
     }
 }
 /**
  * @param stdClass $result
  */
 public function loadResult(stdClass $result)
 {
     parent::loadResult($result);
     if (isset($result->photos)) {
         $this->photos = [];
         foreach ($result->photos[0] as $photo) {
             $this->photos[] = new PhotoSize($photo);
         }
     }
 }
Esempio n. 6
0
 /**
  * @param array $attributes
  */
 public function loadRelated(array $attributes)
 {
     parent::loadRelated($attributes);
     if (isset($attributes['message'])) {
         $this->message = Message::create($attributes['message']);
     }
     if (isset($attributes['edited_message'])) {
         $this->edited_message = Message::create($attributes['edited_message']);
     }
     if (isset($attributes['inline_query'])) {
         $this->inline_query = InlineQuery::create($attributes['inline_query']);
     }
     if (isset($attributes['chosen_inline_result'])) {
         $this->chosen_inline_result = ChosenInlineResult::create($attributes['chosen_inline_result']);
     }
     if (isset($attributes['callback_query'])) {
         $this->callback_query = CallbackQuery::create($attributes['callback_query']);
     }
 }
Esempio n. 7
0
 /**
  * @param stdClass $result
  */
 public function loadResult(stdClass $result)
 {
     parent::loadResult($result);
     if (isset($result->from)) {
         $this->from = new User($result->from);
     }
     if (isset($result->chat)) {
         $this->chat = isset($result->chat->title) ? new GroupChat($result->chat) : new User($result->chat);
     }
     if (isset($result->forward_from)) {
         $this->forward_from = new User($result->forward_from);
     }
     if (isset($result->reply_to_message)) {
         $this->reply_to_message = new static($result->reply_to_message);
     }
     if (isset($result->audio)) {
         $this->audio = new Audio($result->audio);
     }
     if (isset($result->document)) {
         $this->document = new Document($result->document);
     }
     if (isset($result->photo)) {
         $this->photo = [];
         foreach ($result->photo as $photo) {
             $this->photo[] = new PhotoSize($photo);
         }
     }
     if (isset($result->sticker)) {
         $this->sticker = new Sticker($result->sticker);
     }
     if (isset($result->video)) {
         $this->video = new Video($result->video);
     }
     if (isset($result->contact)) {
         $this->contact = new Contact($result->contact);
     }
     if (isset($result->location)) {
         $this->location = new Location($result->location);
     }
     if (isset($result->new_chat_participant)) {
         $this->new_chat_participant = new User($result->new_chat_participant);
     }
     if (isset($result->left_chat_participant)) {
         $this->left_chat_participant = new User($result->left_chat_participant);
     }
     if (isset($result->location)) {
         $this->location = new Location($result->location);
     }
     if (isset($result->new_chat_photo)) {
         $this->new_chat_photo = [];
         foreach ($result->new_chat_photo as $photo) {
             $this->new_chat_photo[] = new PhotoSize($photo);
         }
     }
 }