本文整理汇总了PHP中Helper::formatQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP Helper::formatQuery方法的具体用法?PHP Helper::formatQuery怎么用?PHP Helper::formatQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Helper
的用法示例。
在下文中一共展示了Helper::formatQuery方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Db
<?php
/* Reformatted 12.11.2015 */
// helpers nad includes
include_once '/var/www/html/Lux/Core/Helper.php';
// Create Database Connection
$db = new Db("SocialNetwork");
$OUTPUT = new Output();
// Get Request Data
$REQUEST = new Request();
// No privleges Required
$RULES = new Rules(0, "profile");
// Selects collection from Database Connection
$collectionName = Helper::getCollectionName($REQUEST, "Groups");
$collection = $db->selectCollection($collectionName);
// Format Query
$query = Helper::formatQuery($REQUEST, "group_id");
// Used for anayltics
$LOG = new Logging("Groups.query");
$LOG->log($RULES->getId(), 72, $query, 100, "Groups Queried");
// Find Documents in Collection
$documents = $collection->find($query);
// Output
$OUTPUT->success(1, $documents);
?>
示例2: Db
<?php
/* Reformatted 12.11.2015 */
// Helper functions adn includes
include_once '/var/www/html/Lux/Core/Helper.php';
// Create Database Connection
$DB = new Db("Auth");
$OUTPUT = new Output();
// Get Request Data
$REQUEST = new Request();
// Admin Privleges required
$RULES = new Rules(5, "providers");
// Selects Collection From Database Connection
$collectionName = Helper::getCollectionName($REQUEST, "Providers");
$collection = $DB->selectCollection($collectionName);
// provider name required for specific query (otherwise all will be returned)
$query = Helper::formatQuery($REQUEST, "provider_name", null, array("protocol" => "OAuth2"));
// Used for analytics
$LOG = new Logging("Auth2.query");
$LOG->log($RULES->getId(), 112, $query, 100, "User viewed items in cart/wishlist");
// Find Documents in Collection
$documents = $collection->find($query);
// Output
$OUTPUT->success(1, $documents);
示例3: Db
/* Reformatted 12.11.2015 */
// Helper and includes
include_once '/var/www/html/Lux/Core/Helper.php';
// Create Database Connection
$DB = new Db("System");
$OUTPUT = new Output();
// Get Request Variables
$REQUEST = new Request();
// Admin Privleges needed
$RULES = new Rules(5, "cms");
// Select Collection From Database Connection
$collectionName = Helper::getCollectionName($REQUEST, "Content");
$collection = $DB->selectCollection($collectionName);
// Format Query
$query = Helper::formatQuery($REQUEST, "field_name");
// Values which are permitted by the Adjustment Script
$permitted = array("field_name", "content.full", "content.short", "header.text", "header.sub", "header.url_safe", "picture.banner", "picture.other[]", "picture.slideshow[]");
// Format Update and options
$update = Helper::updatePermitted($REQUEST, $permitted);
$options = Helper::formatOptions($REQUEST);
// Used for analytics
$LOG = new Logging("CMS.adjust");
$LOG->log($RULES->getId(), 51, $query, 100, "Content Updated");
// Find And Modify Documents in Collection
$document = $collection->findAndModify($query, $update, $options);
// Output
$OUTPUT->success(0, $document);
?>
示例4: Db
<?php
include_once '/var/www/html/Lux/Core/Helper.php';
$DB = new Db("SocialNetwork");
$OUTPUT = new Output();
$collection = $DB->selectCollection("Messages");
$REQUEST = new Request();
$RULES = new Rules(1, "social");
$query = Helper::formatQuery($REQUEST, "id", "thread_id");
$options = Helper::formatLimits($REQUEST);
$document = $collection->find($query, $options);
$OUTPUT->success(0, $document);
?>
示例5: Db
<?php
/* Reformatted 12.11.2015 */
// Helper script and includes
include_once '/var/www/html/Lux/Core/Helper.php';
// Create Database Connection
$DB = new Db("System");
$OUTPUT = new Output();
// Get Request Data
$REQUEST = new Request();
// Admin privleges needed
$RULES = new Rules(5, "accounts");
// Selects Collection from Databse Connection
$collectionName = Helper::getCollectionName($REQUEST, "Accounts", false);
$collection = $DB->selectCollection($collectionName);
// Format Query
$query = Helper::formatQuery($REQUEST, "user", "system_info.user");
// Used for Analytics
$LOG = new Logging("Accounts.query");
$LOG->log($RULES->getId(), 2, $RULES->getId(), 100, "User Account Queried");
// Find Documents in Collection
$documents = $collection->find($query);
// Output
$OUTPUT->success(0, $documents);
?>
示例6: Db
<?php
/* Reformatted 12.11.2015 */
// Helper script and includes
include_once '/var/www/html/Lux/Core/Helper.php';
// Create Database Connection
$db = new Db("SocialNetwork");
$OUTPUT = new Output();
// Get Request Data
$REQUEST = new Request();
// No Privleeges needed
$RULES = new Rules(0, "profile");
// Select Collection From Database Connection
$collectionName = Helper::getCollectionName($REQUEST, "Users");
$collection = $db->selectCollection($collectionName);
// Format Query
$query = Helper::formatQuery($REQUEST);
// Used for anayltics
$LOG = new Logging("Profile.query");
$LOG->log($RULES->getId(), 92, $query, 100, "Social Network Profile Queried");
// Find Documents
$documents = $collection->find($query);
// Output
$OUTPUT->success(1, $documents);
?>
示例7: Db
/* Reformatted 12.11.2015 */
// Helper script and include
include_once '/var/www/html/Lux/Core/Helper.php';
// Create Database Connection
$DB = new Db("System");
$OUTPUT = new Output();
// Get Request Data
$REQUEST = new Request();
// No Privleges Needed
$RULES = new Rules(0, "session");
// Selects Collection From Database Connection
$collectionName = Helper::getCollectionName($REQUEST, "Sessions");
$collection = $DB->selectCollection($collectionName);
// Format Query
$query = Helper::formatQuery($REQUEST, "sid");
// Used for anayltics
$LOG = new Logging("Session.query");
$LOG->log($RULES->getId(), 102, $query, 100, "Session Variable Queried");
// Find Documents in Collection
$documents = $collection->find($query);
// Only Available for Sessions:
if ($REQUEST->avail("sid")) {
$SESSION = new Session($REQUEST->get("sid"));
} else {
$SESSION = new Session();
}
if ($REQUEST->avail("key")) {
$OUTPUT->success(1, $SESSION->get($REQUEST->get("key")), $documents);
} else {
$OUTPUT->success(1, $SESSION->get(), $documents);
示例8: Db
<?php
/* Reformatted 12.11.2015 */
// Helper function's and includes
include_once '/var/www/html/Lux/Core/Helper.php';
// Create Database Connection
$db = new Db("Scoreboard");
$OUTPUT = new Output();
// Get Request Variables
$REQUEST = new Request();
// No Priveleges needed
$RULES = new Rules(0, "scoreboard");
// Select collection
$collectionName = Helper::getCollectionName($REQUEST, "Users");
$collection = $db->selectCollection($collectionName);
// Find Ownership Rules
$OWNERSHIP = new Ownership($RULES);
// Format a query from the request
$query = Helper::formatQuery($REQUEST, "user_id", "user_id");
// Used for analytics
$LOG = new Logging("Asset.query");
$LOG->log($RULES->getId(), 32, $query, 100, "User Queried Asset");
// Find Documents in Collection
$documents = $collection->find($query);
// Filter out unOwned Documents
$documents = $OWNERSHIP->query($documents);
// Output
$OUTPUT->success(1, $documents);
示例9: Db
<?php
/* Reformatted 12.11.2015 */
// Helper script and includes
include_once '/var/www/html/Lux/Core/Helper.php';
// Create Database Connection
$DB = new Db("Auth");
$OUTPUT = new Output();
// Get Request Data
$REQUEST = new Request();
// Admin Privleges Required
$RULES = new Rules(5, "oauth");
// Selects Collection from Databse Connection
$collectionName = Helper::getCollectionName($REQUEST, "Clients");
$collection = $DB->selectCollection($collectionName);
// Format Query
$query = Helper::formatQuery($REQUEST, "client_name");
// Used for anayltics
$LOG = new Logging("OAuth.query");
$LOG->log($RULES->getId(), 72, $query, 100, "OAuth Providers Queried");
// Find Documents in Collection
$documents = $collection->find($query);
// Output
$OUTPUT->success(0, $documents);
?>
示例10: Db
/* Reformatted 12.11.2015 */
// Helper and includes
include_once '/var/www/html/Lux/Core/Helper.php';
// Create Database Connection
$DB = new Db("System");
$OUTPUT = new Output();
// Get Request Variables
$REQUEST = new Request();
// Admin privleges required
$RULES = new Rules(5, "contact");
// Select Collection From Database Connection
$collectionName = Helper::getCollectionName($REQUEST, "Contact");
$collection = $DB->selectCollection($collectionName);
// Format Query
$query = Helper::formatQuery($REQUEST, "email_id");
//array("email_id" => $REQUEST->get("email_id"));
// values that are accepted by the adjustment script
$permitted = array("address[]", "address", "sender", "email_id");
// Format and Update Options
$update = Helper::updatePermitted($REQUEST, $permitted);
$options = Helper::formatOptions($REQUEST);
// Used for analytics
$LOG = new Logging("Contact.adjust");
$LOG->log($RULES->getId(), 61, $query, 100, "Content Updated");
// Find and Modify Documents in Collection
$document = $collection->findAndModify($query, $update, $options);
// Output
$OUTPUT->success(0, $document);
?>
示例11: Db
<?php
include_once '/var/www/html/Lux/Core/Helper.php';
$db = new Db("Inventory");
$OUTPUT = new Output();
$REQUEST = new Request();
$orders = $db->selectCollection("Orders");
$RULES = new Rules(1, "orders");
$REQUEST = new Request();
// get the asset, push it into the cart that is selected
$document = $orders->findAndModify(Helper::formatQuery($REQUEST), array("shipper_id" => $RULES->getId(), "status.shipped" => true, "status.recieved" => true, "status.paid" => true, "status.modified" => true, "status.processed" => true, "status.finalized" => true));
$OUTPUT->success(0, $document, null);