public function __construct($data)
 {
     $data = (object) $data;
     $this->c_id = (int) $data->c_id;
     $this->id = (int) $data->id;
     $this->path = $data->path;
     $this->comment = $data->comment;
     $this->title = $data->title;
     $this->filetype = $data->filetype;
     $this->size = (int) $data->size;
     $this->readonly = (bool) $data->readonly;
     $this->session_id = (int) $data->session_id;
     $this->course = null;
     if (isset($data->property_id)) {
         $property = (array) $data;
         $property = (object) $property;
         $property->id = $property->property_id;
         $this->item_property = ItemProperty::create($property);
     } else {
         $this->item_property = null;
     }
 }
 public function __construct($data)
 {
     $data = (object) $data;
     $this->c_id = (int) $data->c_id;
     $this->id = (int) $data->id;
     $this->url = $data->url;
     $this->title = $data->title;
     $this->description = $data->description;
     $this->author = $data->author;
     $this->active = $data->active;
     $this->accepted = $data->accepted;
     $this->post_group_id = $data->post_group_id;
     $this->sent_date = $data->sent_date;
     $this->filetype = $data->filetype;
     $this->has_properties = $data->has_properties;
     $this->view_properties = $data->view_properties;
     $this->qualification = $data->qualification;
     $this->date_of_qualification = $data->date_of_qualification;
     $this->parent_id = $data->parent_id;
     $this->qualificator_id = $data->qualificator_id;
     $this->weight = $data->weight;
     $this->session_id = $data->session_id;
     $this->user_id = $data->user_id;
     $this->allow_text_assignment = $data->allow_text_assignment;
     $this->contains_file = $data->contains_file;
     $this->course = $data->course;
     $this->item_property = $data->item_property;
     $this->course = null;
     if (isset($data->property_id)) {
         $property = (array) $data;
         $property = (object) $property;
         $property->id = $property->property_id;
         $this->item_property = ItemProperty::create($property);
     } else {
         $this->item_property = null;
     }
 }