本文整理汇总了PHP中getEntities函数的典型用法代码示例。如果您正苦于以下问题:PHP getEntities函数的具体用法?PHP getEntities怎么用?PHP getEntities使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getEntities函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
if (!pageArray(2)) {
forward("admin/plugins");
}
$guid = pageArray(2);
adminGateKeeper();
$plugin = getEntity($guid);
classGateKeeper($plugin, "Plugin");
$plugin->status = "disabled";
$plugin->save();
Cache::clear();
Cache::clear();
Admintab::deleteAll();
Setting::updateSettingsTable();
clearCache();
Cache::clear();
Systemvariable::set("setup_complete", false);
$translations = getEntities(array("type" => "Translationentity"));
if ($translations) {
foreach ($translations as $translation) {
$translation->delete();
}
}
new SystemMessage("Your plugin has been disabled.");
forward("admin/plugins");
}
示例2: __construct
public function __construct()
{
if (!pageArray(2) || !pageArray(3)) {
return false;
}
$email = pageArray(2);
$code = pageArray(3);
runHook("action:verify_email:before");
$access = getIgnoreAccess();
setIgnoreAccess();
$user = getEntities(array("type" => "User", "metadata_name_value_pairs" => array(array("name" => "email", "value" => $email), array("name" => "email_verification_code", "value" => $code))));
setIgnoreAccess($access);
if (!$user) {
new SystemMessage(translate("system_message:email_could_not_be_verified"));
forward("home");
}
$user = $user[0];
$user->email_verification_code = NULL;
$user->verified = "true";
$user->save();
runHook("action:verify_email:after");
new SystemMessage(translate("system_message:email_verified"));
new Activity($user->guid, "activity:joined", array($user->getURL(), $user->full_name));
forward("login");
}
示例3: __construct
public function __construct()
{
$guid = pageArray(2);
adminGateKeeper();
$plugin = getEntity($guid);
Setting::updateSettingsTable();
clearCache();
Cache::clear();
Cache::clear();
if ($plugin->enable()) {
new SystemMessage("Plugin Enabled");
new Cache("enabled_plugins_", false, "site");
new Cache("enabled_plugins_reversed", false, "site");
Systemvariable::set("setup_complete", false);
forward("admin/plugins");
}
Setting::updateSettingsTable();
clearCache();
Cache::clear();
Cache::clear();
Admintab::deleteAll();
$translations = getEntities(array("type" => "Translationentity"));
if ($translations) {
foreach ($translations as $translation) {
$translation->delete();
}
}
new SystemMessage("Your plugin can't be enabled. Check requirements");
forward("admin/plugins");
}
示例4: __construct
public function __construct()
{
adminGateKeeper();
Admintab::deleteAll();
Cache::clear();
Cache::clear();
$plugins = Plugin::getAll();
if ($plugins) {
foreach ($plugins as $plugin) {
$plugin->enable();
}
Cache::clear();
Cache::clear();
Cache::clear();
new SystemMessage("All possible plugins have been enabled.");
}
Systemvariable::set("setup_complete", false);
$translations = getEntities(array("type" => "Translationentity"));
if ($translations) {
foreach ($translations as $translation) {
$translation->delete();
}
}
forward("admin/plugins");
}
示例5: __construct
function __construct()
{
adminGateKeeper();
$ip = pageArray(2);
if ($ip) {
new BlacklistIp($ip);
$params = array("type" => "User", "metadata_name_value_pairs" => array(array("name" => "ip1", "value" => $ip), array("name" => "ip2", "value" => $ip)), "metadata_name_value_pairs_operand" => "OR");
$users = getEntities($params);
$tables = Dbase::getAllTables(false);
foreach ($users as $user) {
new BlacklistEmail($user->email);
$guid = $user->guid;
foreach ($tables as $table) {
$entities = getEntities(array("type" => $table, "metadata_name_value_pairs" => array(array("name" => "owner_guid", "value" => $guid), array("name" => "container_guid", "value" => $guid)), "metadata_name_value_pairs_operand" => "OR"));
if ($entities) {
foreach ($entities as $entity) {
$entity->delete();
}
}
}
$user->delete();
}
new SystemMessage("Ip {$ip} has been banned, and all users using it have been deleted.");
forward("home");
}
}
示例6: render
static function render($text, $type = null, $id = null, $instructions = null)
{
global $conf, $baseurl, $db;
// Unfortunately dokuwiki also uses $conf
$fs_conf = $conf;
$conf = array();
// Dokuwiki generates some notices
error_reporting(E_ALL ^ E_NOTICE);
if (!$instructions) {
include_once BASEDIR . '/plugins/dokuwiki/inc/parser/parser.php';
}
require_once BASEDIR . '/plugins/dokuwiki/inc/common.php';
require_once BASEDIR . '/plugins/dokuwiki/inc/parser/xhtml.php';
// Create a renderer
$Renderer = new Doku_Renderer_XHTML();
if (!is_string($instructions) || strlen($instructions) < 1) {
$modes = p_get_parsermodes();
$Parser = new Doku_Parser();
// Add the Handler
$Parser->Handler = new Doku_Handler();
// Add modes to parser
foreach ($modes as $mode) {
$Parser->addMode($mode['mode'], $mode['obj']);
}
$instructions = $Parser->parse($text);
// Cache the parsed text
if (!is_null($type) && !is_null($id)) {
$fields = array('content' => serialize($instructions), 'type' => $type, 'topic' => $id, 'last_updated' => time());
$keys = array('type', 'topic');
//autoquote is always true on db class
$db->Replace('{cache}', $fields, $keys);
}
} else {
$instructions = unserialize($instructions);
}
$Renderer->smileys = getSmileys();
$Renderer->entities = getEntities();
$Renderer->acronyms = getAcronyms();
$Renderer->interwiki = getInterwiki();
$conf = $fs_conf;
$conf['cachedir'] = FS_CACHE_DIR;
// for dokuwiki
$conf['fperm'] = 0600;
$conf['dperm'] = 0700;
// Loop through the instructions
foreach ($instructions as $instruction) {
// Execute the callback against the Renderer
call_user_func_array(array(&$Renderer, $instruction[0]), $instruction[1]);
}
$return = $Renderer->doc;
// Display the output
if (Get::val('histring')) {
$words = explode(' ', Get::val('histring'));
foreach ($words as $word) {
$return = html_hilight($return, $word);
}
}
return $return;
}
示例7: getNotificationCount
static function getNotificationCount($guid)
{
$access = getIgnoreAccess();
setIgnoreAccess();
$count = getEntities(array("type" => "Notification", "count" => true, "metadata_name_value_pairs" => array(array("name" => "owner_guid", "value" => getLoggedInUserGuid()))));
setIgnoreAccess($access);
return $count;
}
示例8: get
static function get($name = false, $type = false)
{
$params = array("type" => "Metatag", "metadata_name_value_pairs" => array(array("name" => "metatag_name", "value" => $name), array("name" => "metatag_type", "value" => $type)));
if ($name && $type) {
return getEntity($params);
} else {
unset($params['metadata_name_value_pairs']);
return getEntities($params);
}
}
示例9: __construct
public function __construct()
{
$limit = getInput("limit", 10);
$offset = getInput("offset", 0);
$count = getEntities(array("type" => "File", "count" => true, "metadata_name_value_pairs" => array(array("name" => "owner_guid", "value" => getLoggedInUserGuid()), array("name" => "title", "value" => "NULL", "operand" => "!="))));
$files = listEntities(array("type" => "File", "limit" => $limit, "offset" => $offset, "metadata_name_value_pairs" => array(array("name" => "owner_guid", "value" => getLoggedInUserGuid()), array("name" => "title", "value" => "NULL", "operand" => "!="))));
$pagination = display("page_elements/pagination", array("count" => $count, "offset" => $offset, "limit" => $limit, "url" => getSiteURL() . "files"));
$page = drawPage(array("header" => "Files", "body" => $files, "footer" => $pagination, "button" => "<a href='" . getSiteURL() . "file/upload' class='btn btn-success'>Upload a File</a>"));
$this->html = $page;
}
示例10: __construct
public function __construct()
{
adminGateKeeper();
$metatags = getEntities(array("type" => "Metatag"));
foreach ($metatags as $metatag) {
$metatag->delete();
}
Systemvariable::set("setup_complete", "false");
new SystemMessage("Default values have been loaded.");
forward();
}
示例11: __construct
public function __construct()
{
adminGateKeeper();
$settings = getEntities(array("type" => "Setting"));
foreach ($settings as $setting) {
$setting->delete();
}
Systemvariable::set("setup_complete", "false");
clearCache();
Cache::clear();
forward();
}
示例12: likers
static function likers($guid)
{
$users = NULL;
$likes = getEntities(array("type" => "Like", "metadata_name" => "container_guid", "metadata_value" => $guid, "limit" => 100));
if ($likes) {
foreach ($likes as $like) {
$users .= getEntity($like->owner_guid)->full_name . "
";
}
return $users;
}
return false;
}
示例13: __construct
public function __construct()
{
gateKeeper();
$email_users = array();
$container_guid = getInput("container_guid");
$topic = getEntity($container_guid);
$category_guid = $topic->container_guid;
$category = getEntity($category_guid);
$description = getInput("comment");
$comment = new Forumcomment();
$comment->description = $description;
$comment->container_guid = $container_guid;
$comment->category_guid = $category_guid;
$comment->owner_guid = getLoggedInUserGuid();
$comment->save();
new SystemMessage("Your comment has been posted.");
new Activity(getLoggedInUserGuid(), "forum:comment:posted", array(getLoggedInUser()->getURL(), getLoggedInUser()->full_name, $topic->getURL(), $topic->title, truncate($comment->description)), $container_guid, $category->access_id);
$all_comments = getEntities(array("type" => "Forumcomment", "metadata_name" => "container_guid", "metadata_value" => $container_guid));
$notify_users = array($topic->owner_guid);
$container_owner_guid = $topic->owner_guid;
$container_owner = getEntity($container_owner_guid);
if ($container_owner->notify_when_forum_comment_topic_i_own == "email" || $container_owner->notify_when_forum_comment_topic_i_own == "both") {
$email_users[] = $container_guid;
}
foreach ($all_comments as $comment) {
$user_guid = $comment->owner_guid;
$user = getEntity($user_guid);
switch ($user->notify_when_forum_comment_topic_i_own) {
case "both":
$notify_users[] = $comment->owner_guid;
$email_users[] = $comment->owner_guid;
break;
case "email":
$email_users[] = $comment->owner_guid;
break;
case "site":
$notify_users[] = $comment->owner_guid;
break;
case "none":
break;
}
}
$notify_users = array_unique($notify_users);
foreach ($notify_users as $user_guid) {
notifyUser("forumcomment", $container_guid, getLoggedInUserGuid(), $user_guid);
}
foreach ($email_users as $user) {
$params = array("to" => array($user->full_name, $user->email), "from" => array(getSiteName(), getSiteEmail()), "subject" => "You have a new comment.", "body" => "You have a new comment. Click <a href='{$url}'>Here</a> to view it.", "html" => true);
sendEmail($params);
}
forward();
}
示例14: __construct
public function __construct()
{
$guid = pageArray(2);
if (getLoggedInUserGuid() == $guid) {
$notifications = getEntities(array("type" => "Notification", "owner_guid" => $guid));
if ($notifications) {
foreach ($notifications as $notification) {
$notification->delete();
}
}
}
forward();
}
示例15: __construct
function __construct()
{
$guid = pageArray(2);
$group = getEntity($guid);
if (loggedInUserCanDelete($group)) {
$group->delete();
}
$memberships = getEntities(array("type" => "Groupmembership", "metadata_name" => "container_guid", "metadata_value" => $guid));
foreach ($memberships as $membership) {
$membership->delete();
}
new SystemMessage("Your group has been deleted.");
forward("groups");
}