当前位置: 首页>>代码示例>>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;未经允许,请勿转载。