/** * @param stdClass $result */ public function loadResult(stdClass $result) { parent::loadResult($result); if (isset($result->thumb)) { $this->thumb = new PhotoSize($result->thumb); } }
public function loadResult(stdClass $result) { parent::loadResult($result); if (isset($result->message)) { $this->message = new Message($result->message); } }
/** * @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); } } }
/** * @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); } } }