当前位置: 首页>>代码示例>>PHP>>正文


PHP ilObject::getType方法代码示例

本文整理汇总了PHP中ilObject::getType方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObject::getType方法的具体用法?PHP ilObject::getType怎么用?PHP ilObject::getType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ilObject的用法示例。


在下文中一共展示了ilObject::getType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getInstanceByObject

 /**
  * Get settings handler for repository object
  * 
  * @param ilObject $a_content_obj
  * @return ilECSObjectSettings
  */
 public static function getInstanceByObject(ilObject $a_content_obj)
 {
     switch ($a_content_obj->getType()) {
         case 'crs':
             include_once 'Modules/Course/classes/class.ilECSCourseSettings.php';
             return new ilECSCourseSettings($a_content_obj);
         case 'cat':
             include_once 'Modules/Category/classes/class.ilECSCategorySettings.php';
             return new ilECSCategorySettings($a_content_obj);
         case 'file':
             include_once 'Modules/File/classes/class.ilECSFileSettings.php';
             return new ilECSFileSettings($a_content_obj);
         case 'glo':
             include_once 'Modules/Glossary/classes/class.ilECSGlossarySettings.php';
             return new ilECSGlossarySettings($a_content_obj);
         case 'grp':
             include_once 'Modules/Group/classes/class.ilECSGroupSettings.php';
             return new ilECSGroupSettings($a_content_obj);
         case 'lm':
             include_once 'Modules/LearningModule/classes/class.ilECSLearningModuleSettings.php';
             return new ilECSLearningModuleSettings($a_content_obj);
         case 'wiki':
             include_once 'Modules/Wiki/classes/class.ilECSWikiSettings.php';
             return new ilECSWikiSettings($a_content_obj);
     }
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:32,代码来源:class.ilECSObjectSettings.php

示例2: handleAutoRating

 /**
  * Activate rating automatically if parent container setting 
  * 
  * @param ilObject $a_new_obj
  */
 protected function handleAutoRating(ilObject $a_new_obj)
 {
     if (ilObject::hasAutoRating($a_new_obj->getType(), $a_new_obj->getRefId()) && method_exists($a_new_obj, "setRating")) {
         $a_new_obj->setRating(true);
         $a_new_obj->update();
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:12,代码来源:class.ilObjectGUI.php

示例3: createPreview

 /**
  * Creates the preview for the object with the specified id.
  * 
  * @param ilObject $a_obj The object to create the preview for.
  * @param bool $a_force true, to force the creation of the preview; false, to create the preview only if needed.
  * @return bool true, if the preview was created; otherwise, false.
  */
 public static function createPreview($a_obj, $a_force = false)
 {
     $preview = new ilPreview($a_obj->getId(), $a_obj->getType());
     return $preview->create($a_obj, $a_force);
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:12,代码来源:class.ilPreview.php

示例4: __appendObjectProperties

 /**
  * Append object properties
  * @param ilObject $obj
  */
 public function __appendObjectProperties(ilObject $obj)
 {
     switch ($obj->getType()) {
         case 'file':
             include_once './Modules/File/classes/class.ilObjFileAccess.php';
             $size = ilObjFileAccess::_lookupFileSize($obj->getId());
             $extension = ilObjFileAccess::_lookupSuffix($obj->getId());
             $this->xmlStartTag('Properties');
             $this->xmlElement("Property", array('name' => 'fileSize'), (int) $size);
             $this->xmlElement("Property", array('name' => 'fileExtension'), (string) $extension);
             // begin-patch fm
             $this->xmlElement('Property', array('name' => 'fileVersion'), (string) ilObjFileAccess::_lookupVersion($obj->getId()));
             // end-patch fm
             $this->xmlEndTag('Properties');
             break;
     }
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:21,代码来源:class.ilObjectXMLWriter.php

示例5: getType

 final function getType()
 {
     return parent::getType();
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:4,代码来源:class.ilObject2.php

示例6: testSetGetLookup

 public function testSetGetLookup()
 {
     global $ilUser;
     $obj = new ilObject();
     $obj->setType("");
     // otherwise type check will fail
     $obj->setTitle("TestObject");
     $obj->setDescription("TestDescription");
     $obj->setImportId("imp_44");
     $obj->create();
     $obj->createReference();
     $id = $obj->getId();
     $ref_id = $obj->getRefId();
     $obj = new ilObject($id, false);
     if ($obj->getType() == "") {
         $value .= "sg1-";
     }
     if ($obj->getTitle() == "TestObject") {
         $value .= "sg2-";
     }
     if ($obj->getDescription() == "TestDescription") {
         $value .= "sg3-";
     }
     if ($obj->getImportId() == "imp_44") {
         $value .= "sg4-";
     }
     if ($obj->getOwner() == $ilUser->getId()) {
         $value .= "sg5-";
     }
     $obj = new ilObject($ref_id);
     if ($obj->getTitle() == "TestObject") {
         $value .= "sg6-";
     }
     if ($obj->getCreateDate() == ($lu = $obj->getLastUpdateDate())) {
         $value .= "sg7-";
     }
     $obj->setTitle("TestObject2");
     sleep(2);
     // we want a different date here...
     $obj->update();
     $obj = new ilObject($ref_id);
     if ($lu != ($lu2 = $obj->getLastUpdateDate())) {
         $value .= "up1-";
     }
     if ($obj->getTitle() == "TestObject2") {
         $value .= "up2-";
     }
     if ($id == ilObject::_lookupObjIdByImportId("imp_44")) {
         $value .= "lu1-";
     }
     if ($ilUser->getFullname() == ilObject::_lookupOwnerName(ilObject::_lookupOwner($id))) {
         $value .= "lu2-";
     }
     if (ilObject::_lookupTitle($id) == "TestObject2") {
         $value .= "lu3-";
     }
     if (ilObject::_lookupDescription($id) == "TestDescription") {
         $value .= "lu4-";
     }
     if (ilObject::_lookupLastUpdate($id) == $lu2) {
         $value .= "lu5-";
     }
     if (ilObject::_lookupObjId($ref_id) == $id) {
         $value .= "lu6-";
     }
     if (ilObject::_lookupType($id) == "") {
         $value .= "lu7-";
     }
     if (ilObject::_lookupObjectId($ref_id) == $id) {
         $value .= "lu8-";
     }
     $ar = ilObject::_getAllReferences($id);
     if (is_array($ar) && count($ar) == 1 && $ar[$ref_id] == $ref_id) {
         $value .= "lu9-";
     }
     $ids = ilObject::_getIdsForTitle("TestObject2");
     foreach ($ids as $i) {
         if ($i == $id) {
             $value .= "lu10-";
         }
     }
     $obs = ilObject::_getObjectsByType("usr");
     foreach ($obs as $ob) {
         if ($ob["obj_id"] == $ilUser->getId()) {
             $value .= "lu11-";
         }
     }
     $d1 = ilObject::_lookupDeletedDate($ref_id);
     ilObject::_setDeletedDate($ref_id);
     $d2 = ilObject::_lookupDeletedDate($ref_id);
     ilObject::_resetDeletedDate($ref_id);
     $d3 = ilObject::_lookupDeletedDate($ref_id);
     if ($d1 != $d2 && $d1 == $d3 && $d3 == null) {
         $value .= "dd1-";
     }
     $obj->delete();
     $this->assertEquals("sg1-sg2-sg3-sg4-sg5-sg6-sg7-up1-up2-" . "lu1-lu2-lu3-lu4-lu5-lu6-lu7-lu8-lu9-lu10-lu11-dd1-", $value);
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:98,代码来源:ilObjectTest.php


注:本文中的ilObject::getType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。