예제 #1
0
 public function __construct($id = 0, $data = array())
 {
     if (empty($id)) {
         $data['title'] = get_string($this->get_artefact_type(), 'artefact.resume');
     }
     parent::__construct($id, $data);
 }
예제 #2
0
파일: lib.php 프로젝트: Br3nda/mahara
 /**
  * overriding this because profile fields
  * are unique in that except for email, you only get ONE
  * so if we don't get an id, we still need to go look for it
  */
 public function __construct($id = 0, $data = null)
 {
     $type = $this->get_artefact_type();
     if (!empty($id) || $type == 'email') {
         return parent::__construct($id, $data);
     }
     if (!empty($data['owner'])) {
         if ($a = get_record('artefact', 'artefacttype', $type, 'owner', $data['owner'])) {
             return parent::__construct($a->id, $a);
         } else {
             $this->owner = $data['owner'];
         }
     }
     $this->ctime = time();
     $this->atime = time();
     $this->artefacttype = $type;
     if (empty($id)) {
         $this->dirty = true;
         $this->ctime = $this->mtime = time();
         if (empty($data)) {
             $data = array();
         }
         foreach ((array) $data as $field => $value) {
             if (property_exists($this, $field)) {
                 $this->{$field} = $value;
             }
         }
     }
 }
예제 #3
0
파일: lib.php 프로젝트: rboyatt/mahara
 public function __construct($id = 0, $data = null)
 {
     parent::__construct($id, $data);
     if ($this->id && ($extra = get_record('artefact_annotation_feedback', 'artefact', $this->id))) {
         foreach ($extra as $name => $value) {
             if (property_exists($this, $name)) {
                 $this->{$name} = $value;
             }
         }
     }
 }
예제 #4
0
 /**
  * We override the constructor to fetch the extra data.
  *
  * @param integer
  * @param object
  */
 public function __construct($id = 0, $data = null)
 {
     parent::__construct($id, $data);
     if ($this->id) {
         if ($pdata = get_record('artefact_cpds_activity', 'artefact', $this->id, null, null, null, null, '*, ' . db_format_tsfield('startdate') . ', ' . db_format_tsfield('enddate'))) {
             foreach ($pdata as $name => $value) {
                 if (property_exists($this, $name)) {
                     $this->{$name} = $value;
                 }
             }
         } else {
             // This should never happen unless the user is playing around with activity IDs in the location bar or similar
             throw new ArtefactNotFoundException(get_string('activitydoesnotexist', 'artefact.cpds'));
         }
     }
 }
예제 #5
0
파일: lib.php 프로젝트: Br3nda/mahara
 public function __construct($id = 0, $data = null)
 {
     parent::__construct($id, $data);
     if (empty($this->id)) {
         $this->locked = 0;
     }
     if ($this->id && ($filedata = get_record('artefact_file_files', 'artefact', $this->id))) {
         foreach ($filedata as $name => $value) {
             if (property_exists($this, $name)) {
                 $this->{$name} = $value;
             }
         }
     }
 }
예제 #6
0
파일: lib.php 프로젝트: vohung96/mahara
 public function __construct($id = 0, $data = null)
 {
     parent::__construct($id, $data);
     if (empty($this->id)) {
         $this->allowcomments = get_config_plugin('artefact', 'file', 'commentsallowed' . $this->artefacttype);
     }
 }
예제 #7
0
파일: lib.php 프로젝트: sarahjcotton/mahara
 /**
  * We override the constructor to fetch the extra data.
  *
  * @param integer
  * @param object
  */
 public function __construct($id = 0, $data = null)
 {
     parent::__construct($id, $data);
     if ($this->id) {
         if ($bpdata = get_record('artefact_blog_blogpost', 'blogpost', $this->id)) {
             foreach ($bpdata as $name => $value) {
                 if (property_exists($this, $name)) {
                     $this->{$name} = $value;
                 }
             }
         } else {
             // This should never happen unless the user is playing around with blog post IDs in the location bar or similar
             throw new ArtefactNotFoundException(get_string('blogpostdoesnotexist', 'artefact.blog'));
         }
     } else {
         $this->allowcomments = 1;
         // Turn comments on for new posts
     }
 }
예제 #8
0
 public function __construct($id = 0, $data = null) {
     parent::__construct($id, $data);
 }
예제 #9
0
 public function __construct($id = 0, $data = array())
 {
     parent::__construct($id, $data);
 }
예제 #10
0
 /**
  * We override the constructor to fetch the extra data.
  *
  * @param integer
  * @param object
  */
 public function __construct($id = 0, $data = null)
 {
     parent::__construct($id, $data);
     if ($this->id) {
         if ($pdata = get_record('artefact_ilps_unit', 'artefact', $this->id, null, null, null, null, '*, ' . db_format_tsfield('targetcompletion') . ', ' . db_format_tsfield('datecompleted'))) {
             foreach ($pdata as $name => $value) {
                 if (property_exists($this, $name)) {
                     $this->{$name} = $value;
                 }
             }
         } else {
             // This should never happen unless the user is playing around with unit IDs in the status bar or similar
             throw new ArtefactNotFoundException(get_string('unitdoesnotexist', 'artefact.ilps'));
         }
     }
 }