本文整理汇总了PHP中ilObject::getLastUpdateDate方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObject::getLastUpdateDate方法的具体用法?PHP ilObject::getLastUpdateDate怎么用?PHP ilObject::getLastUpdateDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObject
的用法示例。
在下文中一共展示了ilObject::getLastUpdateDate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLastUpdateDate
final function getLastUpdateDate()
{
return parent::getLastUpdateDate();
}
示例2: create
/**
* Creates the preview.
*
* @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 function create($a_obj, $a_force = false)
{
if (!ilPreviewSettings::isPreviewEnabled()) {
return false;
}
// get renderer for preview
require_once "./Services/Preview/classes/class.ilRendererFactory.php";
$renderer = ilRendererFactory::getRenderer($this);
// no renderer available?
if ($renderer == null) {
return false;
}
// exists, but still pending?
if ($this->getRenderStatus() == self::RENDER_STATUS_PENDING) {
return false;
}
// not forced? check if update really needed
if ($this->getRenderStatus() == self::RENDER_STATUS_CREATED && !$a_force) {
// check last modified against last render date
if ($a_obj->getLastUpdateDate() <= $this->getRenderDate()) {
return false;
}
}
// re-create the directory to store the previews
$this->getStorage()->delete();
$this->getStorage()->create();
// let the renderer create the preview
$renderer->render($this, $a_obj, true);
// save to database
$this->save();
return true;
}
示例3: 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);
}