• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getEntities函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getEntities函数的典型用法代码示例。如果您正苦于以下问题:PHP getEntities函数的具体用法?PHP getEntities怎么用?PHP getEntities使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getEntities函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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");
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:27,代码来源:DisablePluginActionHandler.php


示例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");
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:25,代码来源:VerifyEmailActionHandler.php


示例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");
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:30,代码来源:EnablePluginActionHandler.php


示例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");
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:25,代码来源:EnableAllPluginsActionHandler.php


示例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");
     }
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:26,代码来源:BanIpActionHandler.php


示例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;
 }
开发者ID:canneverbe,项目名称:flyspray,代码行数:59,代码来源:dokuwiki_formattext.inc.php


示例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;
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:8,代码来源:Notification.php


示例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);
     }
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:10,代码来源:Metatag.php


示例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;
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:10,代码来源:FilesPageHandler.php


示例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();
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:11,代码来源:ResetMetaTagsActionHandler.php


示例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();
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:12,代码来源:ResetSettingsActionHandler.php


示例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 . "&#013;";
         }
         return $users;
     }
     return false;
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:12,代码来源:LikesPlugin.php


示例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();
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:52,代码来源:AddForumCommentActionHandler.php


示例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();
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:13,代码来源:DeleteAllNotificationsActionHandler.php


示例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");
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:14,代码来源:DeleteGroupActionHandler.php


示例16: __construct

 function __construct()
 {
     $guid = pageArray(2);
     $chat = getEntity($guid);
     if ($chat->user_one == getLoggedInUserGuid() || $chat->user_two == getLoggedInUserGuid()) {
         $messages = getEntities(array("type" => "Chatmessage", "metadata_name" => "container_guid", "metadata_value" => $guid));
         if ($messages) {
             foreach ($messages as $message) {
                 $message->delete();
             }
         }
     }
     forward();
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:14,代码来源:DeleteChatMessagesActionHandler.php


示例17: __construct

 function __construct()
 {
     adminGateKeeper();
     $logos = getEntities(array("type" => "Logo"));
     if ($logos) {
         foreach ($logos as $logo) {
             $logo->delete();
         }
     }
     $logo = new Logo();
     $logo->save();
     $logo->createAvatar();
     new SystemMessage("Your avatar has been uploaded.");
     forward("admin/logo");
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:15,代码来源:UploadLogoActionHandler.php


示例18: members

 public function members($return_guid = false)
 {
     $memberships = getEntities(array("type" => "Groupmembership", "metadata_name" => "group", "metadata_value" => $this->guid));
     if ($memberships) {
         foreach ($memberships as $membership) {
             if (!$return_guid) {
                 $members[] = getEntity($membership->member_guid);
             } else {
                 $members[] = $membership->member_guid;
             }
         }
         return $members;
     }
     return false;
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:15,代码来源:Group.php


示例19: getMenuItems

 static function getMenuItems()
 {
     $return = NULL;
     $pages = getEntities(array("type" => "Custompage", "order_by" => "weight"));
     if ($pages) {
         foreach ($pages as $page) {
             if ($page->label) {
                 $return .= "<li>";
                 $return .= "<a href='" . getSiteURL() . "pages/" . $page->name . "'>" . display("output/editor", array("value" => $page->label)) . "</a>";
                 $return .= "</li>";
             }
         }
     }
     return $return;
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:15,代码来源:Custompage.php


示例20: __construct

 function __construct()
 {
     $guid = pageArray(2);
     $topic = getEntity($guid);
     classGateKeeper($topic, "Forumtopic");
     if (loggedInUserCanDelete($topic)) {
         $topic->delete();
         $comments = getEntities(array("type" => "Comment", "metadata_name" => "container_guid", "metadata_value" => $guid));
         foreach ($comments as $comment) {
             $comment->delete();
         }
         new SystemMessage("Your topic has been deleted.");
         forward();
     }
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:15,代码来源:DeleteTopicActionHandler.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getEntitiesRestrictRequest函数代码示例发布时间:2022-05-15
下一篇:
PHP getEncounterDateByEncounter函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap