public function fromArray($data) { parent::fromArray($data); if (!empty($data['url'])) { $this->url = $data['url']; } if (!empty($data['title'])) { $this->title = $data['title']; } if (!empty($data['caption'])) { $this->caption = $data['caption']; } if (!empty($data['description'])) { $this->description = $data['description']; } if (!empty($data['is_external'])) { $this->is_external = intval($data['is_external']); } if (!empty($data['preview_page'])) { $this->preview_page = intval($data['preview_page']); } if (!empty($data['preview_url'])) { $this->preview_url = $data['preview_url']; } if (!empty($data['photo']) && is_array($data['photo'])) { $photo = new View_Photo(); $photo->fromArray($data['photo']); $this->photo = $photo; } }
public function fromArray($data) { parent::fromArray($data); if (!empty($data['album_id'])) { $this->album_id = intval($data['album_id']); } if (!empty($data['user_id'])) { $this->user_id = intval($data['user_id']); } if (!empty($data['text'])) { $this->text = $data['text']; } if (!empty($data['date'])) { $this->date = intval($data['date']); } if (!empty($data['photo_75'])) { $this->photo_75 = $data['photo_75']; } if (!empty($data['photo_130'])) { $this->photo_130 = $data['photo_130']; } if (!empty($data['photo_604'])) { $this->photo_604 = $data['photo_604']; } if (!empty($data['photo_807'])) { $this->photo_807 = $data['photo_807']; } if (!empty($data['photo_1280'])) { $this->photo_1280 = $data['photo_1280']; } if (!empty($data['photo_2560'])) { $this->photo_2560 = $data['photo_2560']; } if (!empty($data['width'])) { $this->width = intval($data['width']); } if (!empty($data['height'])) { $this->height = intval($data['height']); } }
public function fromArray($data) { parent::fromArray($data); /* TODO: реализовать */ }