/** * load Question data in the object * @access public * @param content id of the Question. */ public function load($content_id) { Logger::log("Enter: Question::load | Arg: \$content_id = {$content_id}"); Logger::log("Calling: Content::load | Param: \$content_id = {$content_id}"); parent::load($content_id); Logger::log("Exit: Question::load"); return; }
/** * load Video data in the object * @access public * @param content id of the Video. * @param $user_id user id of the person who is accessing data * @param $my_user_id user id of the person whose data is loading */ public function load($content_id, $user_id = 0, $my_user_id = 0) { Logger::log("Enter: Video::load | Arg: \$content_id = {$content_id}"); Logger::log("Calling: Content::load | Param: \$content_id = {$content_id}"); parent::load($content_id); $sql = "SELECT * FROM {videos} WHERE content_id = {$this->content_id}"; $res = Dal::query($sql); if ($res->numRows() > 0) { $row = $res->fetchRow(DB_FETCHMODE_OBJECT); if ($my_user_id != 0) { // getting degree 1 friendlist $relations = Relation::get_relations($user_id, APPROVED, PA::$network_info->network_id); if ($user_id == $my_user_id) { $this->video_file = $row->video_file; $this->file_name = $row->video_file; $this->file_perm = $row->video_perm; } elseif (in_array($my_user_id, $relations)) { if ($row->video_perm == WITH_IN_DEGREE_1 || $row->video_perm == ANYONE) { $this->video_file = $row->video_file; $this->file_name = $row->video_file; $this->file_perm = $row->video_perm; } } elseif ($my_user_id == 0) { if ($row->video_perm == WITH_IN_DEGREE_1 || $row->video_perm == ANYONE) { $this->video_file = $row->video_file; $this->file_name = $row->video_file; $this->file_perm = $row->video_perm; } } else { if ($row->video_perm == ANYONE) { $this->video_file = $row->video_file; $this->file_name = $row->video_file; $this->file_perm = $row->video_perm; } } } else { if ($user_id == $my_user_id) { $this->video_file = $row->video_file; $this->file_name = $row->video_file; $this->file_perm = $row->video_perm; } else { if ($row->video_perm == ANYONE) { $this->video_file = $row->video_file; $this->file_name = $row->video_file; $this->file_perm = $row->video_perm; } } } } Logger::log("Exit: Video::load"); return; }
public function load($cid) { parent::load($cid); // the content part $this->load_by_event_id(Event::get_eid_from_cid($cid)); // the event part }