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


PHP ElggEntity::getPrivateSetting方法代码示例

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


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

示例1: questions_workflow_enabled

/**
 * This function checks if the questions workflow is enabled in the plugin settings and for the given container
 *
 * @return bool true is enabled, false otherwise
 */
function questions_workflow_enabled(ElggEntity $container = null)
{
    if ($container && $container instanceof ElggGroup) {
        return $container->getPrivateSetting('questions_workflow_enabled') == "yes";
    }
    return elgg_get_plugin_setting("workflow_enabled", "questions") == "yes";
}
开发者ID:Pleio,项目名称:questions,代码行数:12,代码来源:functions.php

示例2: questions_get_solution_time

/**
 * Return the number of days it should take to solve a question.
 *
 * @param ElggEntity $container if a group is provided, first the setting of the group is checked, then the default setting of the site
 *
 * @return int
 */
function questions_get_solution_time(ElggEntity $container)
{
    static $plugin_setting;
    if (!isset($plugin_setting)) {
        $plugin_setting = (int) elgg_get_plugin_setting('site_solution_time', 'questions');
    }
    // get site setting
    $result = $plugin_setting;
    // check is group
    if ($container instanceof ElggGroup) {
        // get group setting
        $group_setting = $container->getPrivateSetting('questions_solution_time');
        if ($group_setting !== false && $group_setting !== null) {
            // we have a valid group setting
            $result = (int) $group_setting;
        }
    }
    return $result;
}
开发者ID:lorea,项目名称:Hydra-dev,代码行数:26,代码来源:functions.php

示例3: tag_tools_add_sent_tags

/**
 * Add tags to the sent tags of an entity
 *
 * @param ElggEntity $entity       the entity to add to
 * @param string[]   $sending_tags the newly sent tags
 *
 * @return bool
 */
function tag_tools_add_sent_tags(ElggEntity $entity, $sending_tags = [])
{
    if (!$entity instanceof \ElggEntity) {
        return false;
    }
    if (empty($sending_tags)) {
        // nothing to add
        return true;
    }
    if (!is_array($sending_tags)) {
        $sending_tags = [$sending_tags];
    }
    $sent_tags = $entity->getPrivateSetting('tag_tools:sent_tags');
    if (!empty($sent_tags)) {
        $sent_tags = json_decode($sent_tags, true);
    } else {
        $sent_tags = [];
    }
    // store all processed tags
    $processed_tags = array_merge($sent_tags, $sending_tags);
    $processed_tags = array_unique($processed_tags);
    return $entity->setPrivateSetting('tag_tools:sent_tags', json_encode($processed_tags));
}
开发者ID:coldtrick,项目名称:tag_tools,代码行数:31,代码来源:functions.php

示例4: deleteEntity

 /**
  * Handle the deletion of an ElggEntity
  *
  * @param \ElggEntity $entity the entity
  *
  * @return void
  */
 protected static function deleteEntity(\ElggEntity $entity)
 {
     if (!$entity->getPrivateSetting(ELASTICSEARCH_INDEXED_NAME)) {
         return;
     }
     $client = elasticsearch_get_client();
     if (empty($client)) {
         return;
     }
     elasticsearch_add_document_for_deletion($entity->getGUID(), ['_index' => $client->getIndex(), '_type' => $client->getDocumentTypeFromEntity($entity), '_id' => $entity->getGUID()]);
 }
开发者ID:coldtrick,项目名称:elasticsearch,代码行数:18,代码来源:EventDispatcher.php


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