當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ArtefactType::__construct方法代碼示例

本文整理匯總了PHP中ArtefactType::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP ArtefactType::__construct方法的具體用法?PHP ArtefactType::__construct怎麽用?PHP ArtefactType::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ArtefactType的用法示例。


在下文中一共展示了ArtefactType::__construct方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct($id = 0, $data = array())
 {
     if (empty($id)) {
         $data['title'] = get_string($this->get_artefact_type(), 'artefact.resume');
     }
     parent::__construct($id, $data);
 }
開發者ID:richardmansfield,項目名稱:richardms-mahara,代碼行數:7,代碼來源:lib.php

示例2: __construct

 /**
  * 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;
             }
         }
     }
 }
開發者ID:Br3nda,項目名稱:mahara,代碼行數:34,代碼來源:lib.php

示例3: __construct

 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;
             }
         }
     }
 }
開發者ID:rboyatt,項目名稱:mahara,代碼行數:11,代碼來源:lib.php

示例4: __construct

 /**
  * 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'));
         }
     }
 }
開發者ID:ngson2000,項目名稱:mahara-artefact_cpds,代碼行數:22,代碼來源:lib.php

示例5: __construct

 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);
     }
 }
開發者ID:vohung96,項目名稱:mahara,代碼行數:7,代碼來源:lib.php

示例6: __construct

 /**
  * 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
     }
 }
開發者ID:sarahjcotton,項目名稱:mahara,代碼行數:25,代碼來源:lib.php

示例7: __construct

 public function __construct($id = 0, $data = null) {
     parent::__construct($id, $data);
 }
開發者ID:catalyst,項目名稱:mahara-browseprofiles,代碼行數:3,代碼來源:lib.php

示例8: __construct

 public function __construct($id = 0, $data = array())
 {
     parent::__construct($id, $data);
 }
開發者ID:gbleydon,項目名稱:mahara-survey,代碼行數:4,代碼來源:lib.php


注:本文中的ArtefactType::__construct方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。