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


PHP ElggObject::getContainerGUID方法代码示例

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


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

示例1: removeFolderContents

 /**
  * Remove all the files in this folder
  *
  * @param \ElggObject $entity the folder to removed the file from
  *
  * @return void
  */
 protected static function removeFolderContents(\ElggObject $entity)
 {
     $batch = new \ElggBatch('elgg_get_entities_from_relationship', ['type' => 'object', 'subtype' => 'file', 'container_guid' => $entity->getContainerGUID(), 'limit' => false, 'relationship' => FILE_TOOLS_RELATIONSHIP, 'relationship_guid' => $entity->getGUID()]);
     $batch->setIncrementOffset(false);
     foreach ($batch as $file) {
         $file->delete();
     }
 }
开发者ID:coldtrick,项目名称:file_tools,代码行数:15,代码来源:Folder.php

示例2: testCreateWithContainerGuidEqualsZero

 public function testCreateWithContainerGuidEqualsZero()
 {
     $user = new \ElggUser();
     $user->save();
     $object = new \ElggObject();
     $object->owner_guid = $user->guid;
     $object->container_guid = 0;
     // If container_guid attribute is not updated with owner_guid attribute
     // ElggEntity::getContainerEntity() would return false
     // thus terminating save()
     $this->assertTrue($object->save());
     $this->assertEqual($user->guid, $object->getContainerGUID());
     $user->delete();
 }
开发者ID:elgg,项目名称:elgg,代码行数:14,代码来源:ElggEntityTest.php

示例3: file_tools_change_files_access

/**
 * Change the access of all file in a folder
 *
 * @param ElggObject $folder the folder to change the file access for
 *
 * @return void
 */
function file_tools_change_files_access($folder)
{
    if (!empty($folder) && $folder instanceof ElggObject) {
        if ($folder->getSubtype() == FILE_TOOLS_SUBTYPE) {
            // change access on files in this folder
            $options = array("type" => "object", "subtype" => "file", "container_guid" => $folder->getContainerGUID(), "limit" => false, "relationship" => FILE_TOOLS_RELATIONSHIP, "relationship_guid" => $folder->getGUID());
            if ($files = elgg_get_entities_from_relationship($options)) {
                // need to unregister an event listener
                elgg_unregister_event_handler("update", "object", "file_tools_object_handler");
                foreach ($files as $file) {
                    $file->access_id = $folder->access_id;
                    $file->save();
                }
            }
        }
    }
}
开发者ID:lorea,项目名称:Hydra-dev,代码行数:24,代码来源:functions.php

示例4: while

    }
}
// need to add check to make sure user can write to container
$page->container_guid = $container_guid;
// allow moving of subpages
if ($parent_guid && $parent_guid != $page_guid) {
    // Check if parent isn't below the page in the tree
    if (!$new_page && $page->parent_guid != $parent_guid) {
        $tree_page = get_entity($parent_guid);
        while ($tree_page->parent_guid > 0 && $page_guid != $tree_page->getGUID()) {
            $tree_page = get_entity($tree_page->parent_guid);
        }
        // If is below, bring all child elements forward
        if ($page_guid == $tree_page->getGUID()) {
            $previous_parent = (int) $page->parent_guid;
            $options = array("type" => "object", "subtype" => "page", "container_guid" => $page->getContainerGUID(), "limit" => false, "metadata_name_value_pairs" => array("name" => "parent_guid", "value" => $page->getGUID()));
            if ($children = elgg_get_entities_from_metadata($options)) {
                foreach ($children as $child) {
                    $child->parent_guid = $previous_parent;
                }
            }
        }
    }
    $page->parent_guid = $parent_guid;
}
// allow comments
$page->allow_comments = $allow_comments;
// check for publication/expiration date
$publication_date = get_input("publication_date");
$expiration_date = get_input("expiration_date");
// first reset publication status
开发者ID:amcfarlane1251,项目名称:ongarde,代码行数:31,代码来源:edit.php


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