本文整理汇总了PHP中selector::get方法的典型用法代码示例。如果您正苦于以下问题:PHP selector::get方法的具体用法?PHP selector::get怎么用?PHP selector::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类selector
的用法示例。
在下文中一共展示了selector::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: profile
public function profile($template = "default", $user_id = false)
{
if (!$template) {
$template = "default";
}
list($template_block, $template_bad_user_block) = def_module::loadTemplates("users/profile/" . $template, "profile_block", "bad_user_block");
$block_arr = array();
if (!$user_id) {
$user_id = (int) getRequest('param0');
}
if (!$user_id) {
$permissions = permissionsCollection::getInstance();
if ($permissions->isAuth()) {
$user_id = $permissions->getUserId();
}
}
if ($user = selector::get('object')->id($user_id)) {
$this->validateEntityByTypes($user, array('module' => 'users', 'method' => 'user'));
$block_arr['xlink:href'] = "uobject://" . $user_id;
$userTypeId = $user->getTypeId();
if ($userType = umiObjectTypesCollection::getInstance()->getType($userTypeId)) {
$userHierarchyTypeId = $userType->getHierarchyTypeId();
if ($userHierarchyType = umiHierarchyTypesCollection::getInstance()->getType($userHierarchyTypeId)) {
if ($userHierarchyType->getName() == "users" && $userHierarchyType->getExt() == "user") {
$block_arr['id'] = $user_id;
return def_module::parseTemplate($template_block, $block_arr, false, $user_id);
}
}
}
} else {
throw new publicException(getLabel('error-object-does-not-exist', null, $user_id));
}
return def_module::parseTemplate($template_bad_user_block, $block_arr);
}
示例2: guide_items
public function guide_items($guide_id = false, $per_page = false, $curr_page = 0) {
$this->setDataType("list");
$this->setActionType("modify");
if(!$curr_page) $curr_page = (int) getRequest('p');
if(!$per_page) $per_page = getRequest('per_page_limit');
if(!$per_page) $per_page = $this->per_page;
if(!$guide_id) $guide_id = (int) getRequest('param0');
$mode = (string) getRequest('param1');
if($guide = selector::get('object-type')->id($guide_id)) {
$this->setHeaderLabel(getLabel('header-data-guide_items') . ' "' . $guide->getName() . '"');
}
if($this->ifNotXmlMode()) return $this->doData();
$sel = new selector('objects');
$sel->types('object-type')->id($guide_id);
$sel->limit($per_page * $curr_page, $per_page);
selectorHelper::detectFilters($sel);
if($mode == "do") {
$params = array(
"type_id" => $guide_id
);
$this->saveEditedList("objects", $params);
$this->chooseRedirect();
}
$this->setDataRange($per_page, $curr_page * $per_page);
$data = $this->prepareData($sel->result, "objects");
$this->setData($data, $sel->total);
return $this->doData();
}
示例3: recalcCounts
public function recalcCounts(iUmiHierarchyElement $element)
{
switch ($element->getMethod()) {
case 'topic':
$element->messages_count = $this->calculateCount($element, 'message');
$element->last_message = $this->calculateLastMessageId($element);
$element->commit();
break;
}
$element = selector::get('page')->id($element->getRel());
if (!$element) {
return false;
}
if (!defined('DISABLE_SEARCH_REINDEX')) {
define('DISABLE_SEARCH_REINDEX', '1');
}
switch ($element->getMethod()) {
case 'conf':
$element->messages_count = $this->calculateCount($element, 'message');
$element->topics_count = $this->calculateCount($element, 'topic');
$element->last_message = $this->calculateLastMessageId($element);
$element->commit();
break;
case 'topic':
$element->messages_count = $this->calculateCount($element, 'message');
$element->last_message = $this->calculateLastMessageId($element);
$element->commit();
$this->recalcCounts($element);
break;
}
}
示例4: normalizeIn
public function normalizeIn($v2063c1608d6e0baf80249c42e2be5804, $v16b2b26000987faccb260b9d39df1269 = false)
{
$vad5f82e879a9c5d6b5b442eb37e50551 = null;
if (is_numeric($v2063c1608d6e0baf80249c42e2be5804)) {
$vad5f82e879a9c5d6b5b442eb37e50551 = selector::get('domain')->id($v2063c1608d6e0baf80249c42e2be5804);
} else {
$vad5f82e879a9c5d6b5b442eb37e50551 = selector::get('domain')->host($v2063c1608d6e0baf80249c42e2be5804);
}
return $vad5f82e879a9c5d6b5b442eb37e50551 instanceof iDomain ? (int) $vad5f82e879a9c5d6b5b442eb37e50551->getId() : null;
}
示例5: checkPaymentProps
private static function checkPaymentProps(iUmiObject $object) {
if($object->payment_type_id) {
$types = umiObjectTypesCollection::getInstance();
$typeObject = selector::get('object')->id($object->payment_type_id);
$typeId = $types->getTypeIdByGUID($typeObject->payment_type_guid);
if($typeId != $object->getTypeId()) {
$object->setTypeId($typeId);
$object->commit();
}
}
}
示例6: getClassPrefixByType
public static function getClassPrefixByType($v16b2b26000987faccb260b9d39df1269)
{
static $v0fea6a13c52b4d4725368f24b045ca84 = array();
if (isset($v0fea6a13c52b4d4725368f24b045ca84[$v16b2b26000987faccb260b9d39df1269])) {
return $v0fea6a13c52b4d4725368f24b045ca84[$v16b2b26000987faccb260b9d39df1269];
}
$v6f65638723a69dfa99474478b83b7b17 = '';
$va8cfde6331bd59eb2ac96f8911c4b666 = selector::get('object')->id($v16b2b26000987faccb260b9d39df1269);
if ($va8cfde6331bd59eb2ac96f8911c4b666 instanceof iUmiObject) {
if ($va8cfde6331bd59eb2ac96f8911c4b666->class_name) {
$v6f65638723a69dfa99474478b83b7b17 = $va8cfde6331bd59eb2ac96f8911c4b666->class_name;
}
} else {
throw new coreException("Can't get class name prefix from object #{$v16b2b26000987faccb260b9d39df1269}");
}
return $v0fea6a13c52b4d4725368f24b045ca84[$v16b2b26000987faccb260b9d39df1269] = $v6f65638723a69dfa99474478b83b7b17;
}
示例7: tickets
public function tickets()
{
$mode = getRequest('param0');
$id = getRequest('param1');
$objects = umiObjectsCollection::getInstance();
$buffer = outputBuffer::current();
$buffer->contentType('text/javascript');
$buffer->option('generation-time', false);
$buffer->clear();
$json = new jsonTranslator();
if ($mode == 'create') {
$type = selector::get('object-type')->name('content', 'ticket');
$id = $objects->addObject(null, $type->getId());
}
if ($id) {
$ticket = selector::get('object')->id($id);
$this->validateEntityByTypes($ticket, array('module' => 'content', 'method' => 'ticket'));
} else {
throw new publicException("Wrong params");
}
if ($mode == 'delete') {
$objects->delObject($id);
$buffer->end();
}
$ticket->x = (int) getRequest('x');
$ticket->y = (int) getRequest('y');
$ticket->width = (int) getRequest('width');
$ticket->height = (int) getRequest('height');
$ticket->message = $ticket->name = getRequest('message');
$url = getRequest('referer') ? getRequest('referer') : getServer('HTTP_REFERER');
$url = str_replace("%", "%", $url);
if ($url) {
$ticket->url = $url;
}
if ($mode == 'create') {
$permissions = permissionsCollection::getInstance();
$ticket->user_id = $permissions->getUserId();
}
$ticket->commit();
$data = array('id' => $ticket->id);
$result = $json->translateToJson($data);
$buffer->push($result);
$buffer->end();
}
示例8: __call
public function __call($vea9f6aca279138c58f705c8d4cb4b8ce, $args)
{
$vea9f6aca279138c58f705c8d4cb4b8ce = strtolower($vea9f6aca279138c58f705c8d4cb4b8ce);
if (in_array($vea9f6aca279138c58f705c8d4cb4b8ce, $this->modes)) {
$v2063c1608d6e0baf80249c42e2be5804 = sizeof($args) ? $args[0] : null;
if ($v2063c1608d6e0baf80249c42e2be5804 instanceof iUmiEntinty) {
$v2063c1608d6e0baf80249c42e2be5804 = $v2063c1608d6e0baf80249c42e2be5804->getId();
}
if (isset($this->fieldId)) {
$v06e3d36fa30cea095545139854ad1fb9 = selector::get('field')->id($this->fieldId);
if ($v6b1a57fa235477758817df3c91158006 = $v06e3d36fa30cea095545139854ad1fb9->getRestrictionId()) {
$v3dadfaeb46ec74762b37de11fea7605c = baseRestriction::get($v6b1a57fa235477758817df3c91158006);
if ($v3dadfaeb46ec74762b37de11fea7605c instanceof iNormalizeInRestriction) {
$v2063c1608d6e0baf80249c42e2be5804 = $v3dadfaeb46ec74762b37de11fea7605c->normalizeIn($v2063c1608d6e0baf80249c42e2be5804);
}
}
if (is_numeric($v2063c1608d6e0baf80249c42e2be5804) && substr($v2063c1608d6e0baf80249c42e2be5804, 0, 1) !== "0") {
$v2063c1608d6e0baf80249c42e2be5804 = (double) $v2063c1608d6e0baf80249c42e2be5804;
}
if ($v06e3d36fa30cea095545139854ad1fb9->getDataType() == 'relation' && is_string($v2063c1608d6e0baf80249c42e2be5804)) {
if ($v52eb29c6d8ea0d3a5bb3654f49bbd7c7 = $v06e3d36fa30cea095545139854ad1fb9->getGuideId()) {
$v8be74552df93e31bbdd6b36ed74bdb6a = new selector('objects');
$v8be74552df93e31bbdd6b36ed74bdb6a->types('object-type')->id($v52eb29c6d8ea0d3a5bb3654f49bbd7c7);
$v8be74552df93e31bbdd6b36ed74bdb6a->where('*')->ilike($v2063c1608d6e0baf80249c42e2be5804);
$v2fa47f7c65fec19cc163b195725e3844 = sizeof($v8be74552df93e31bbdd6b36ed74bdb6a->result);
if ($v2fa47f7c65fec19cc163b195725e3844 > 0 && $v2fa47f7c65fec19cc163b195725e3844 < 100) {
$v2063c1608d6e0baf80249c42e2be5804 = $v8be74552df93e31bbdd6b36ed74bdb6a->result;
}
}
}
if ($v06e3d36fa30cea095545139854ad1fb9->getDataType() == 'date' && is_string($v2063c1608d6e0baf80249c42e2be5804)) {
$v5fc732311905cb27e82d67f4f6511f7f = new umiDate();
$v5fc732311905cb27e82d67f4f6511f7f->setDateByString(trim($v2063c1608d6e0baf80249c42e2be5804, ' %'));
$v2063c1608d6e0baf80249c42e2be5804 = $v5fc732311905cb27e82d67f4f6511f7f->getDateTimeStamp();
}
}
$this->value = $v2063c1608d6e0baf80249c42e2be5804;
$this->mode = $vea9f6aca279138c58f705c8d4cb4b8ce;
} else {
throw new selectorException("This property doesn't support \"{$vea9f6aca279138c58f705c8d4cb4b8ce}\" method");
}
}
示例9: getCurrentCurrency
/**
* Получить текущую валюту
* @return iUmiObject текущая валюта
*/
public function getCurrentCurrency()
{
static $currency = null;
if (!is_null($currency)) {
return $currency;
}
if (permissionsCollection::getInstance()->isAuth()) {
$customer = customer::get();
if ($customer->preffered_currency) {
$currencyTypeId = umiObjectTypesCollection::getInstance()->getBaseType('emarket', 'currency');
$currency = selector::get('object')->id($customer->preffered_currency);
if ($currency->typeId == $currencyTypeId) {
return $currency;
}
}
} else {
if ($v = (int) getCookie('customer_currency')) {
return $currency = selector::get('object')->id($v);
}
}
$guest = umiObjectsCollection::getInstance()->getObjectByGUID('system-guest');
if ($v = $guest->getValue('preffered_currency')) {
return $currency = selector::get('object')->id($v);
}
return $currency = $this->getDefaultCurrency();
}
示例10: getLastMessageId
protected function getLastMessageId($elementId)
{
$element = selector::get('page')->id($elementId);
if ($element) {
$lastMessage = $element->last_message;
if (sizeof($lastMessage) && false) {
$lastMessage = getArrayKey($lastMessage, 0);
return $lastMessage instanceof iUmiHierarchyElement ? $lastMessage->id : false;
} else {
$lastMessage = $this->calculateLastMessageId($element);
if ($lastMessage) {
if (!defined('DISABLE_SEARCH_REINDEX')) {
define('DISABLE_SEARCH_REINDEX', '1');
}
$element->last_message = $lastMessage;
$element->commit();
return $lastMessage->id;
}
}
}
return false;
}
示例11: onOrderDelete
public function onOrderDelete(iUmiEventPoint $e)
{
if ($e->getMode() != 'before') {
return;
}
$object = $e->getRef('object');
if ($object instanceof iUmiObject) {
$type = selector::get('object-type')->id($object->getTypeId());
if ($type && $type->getMethod() == 'order') {
$order = order::get($object->id);
$order->unreserve();
$order->commit();
}
}
}
示例12: renderOrderCustomer
/**
* Отрисовать покупателя
* @param order $order
* @return Array
*/
public function renderOrderCustomer(order $order, $template = 'default')
{
$customer = selector::get('object')->id($order->customer_id);
if ($customer instanceof iUmiObject == false) {
throw new publicException(getLabel('error-object-does-not-exist', null, $order->customer_id));
}
list($tpl_user, $tpl_guest) = def_module::loadTemplates("emarket/customer/" . $template, "customer_user", "customer_guest");
$objectType = selector::get('object-type')->id($customer->typeId);
$tpl = $objectType->getModule() == 'users' ? $tpl_user : $tpl_guest;
return def_module::parseTemplate($tpl, array('full:object' => $customer), false, $customer->getId());
}
示例13: getClassPrefix
private static function getClassPrefix($objectTypeId)
{
static $cache = array();
if (isset($cache[$objectTypeId])) {
return $cache[$objectTypeId];
}
$objectType = selector::get('object-type')->id($objectTypeId);
$prefixes = self::getClassPrefixes();
foreach ($prefixes as $prefix => $conds) {
foreach ($conds as $type => $values) {
foreach ($values as $value) {
if ($type == 'fields' && $objectType->getFieldId($value)) {
return $cache[$objectTypeId] = $prefix;
}
if ($type == 'groups' && $objectType->getFieldsGroupByName($value)) {
return $cache[$objectTypeId] = $prefix;
}
}
}
}
return $cache[$objectTypeId] = '';
}
示例14: renderOptioned
private function renderOptioned(umiObjectProperty &$property, $template, $showNull = false)
{
$name = $property->getName();
$title = $property->getTitle();
$value = $property->getValue();
list($tpl_block, $tpl_block_empty, $tpl_item) = self::loadTemplates("data/" . $template, "optioned_block", "optioned_block_empty", "optioned_item");
if (empty($value) && !$showNull) {
return $tpl_block_empty;
}
$items_arr = array();
foreach ($value as $info) {
$objectId = getArrayKey($info, 'rel');
$elementId = getArrayKey($info, 'symlink');
$item_arr = array('int' => getArrayKey($info, 'int'), 'float' => getArrayKey($info, 'float'), 'text' => getArrayKey($info, 'text'), 'varchar' => getArrayKey($info, 'varchar'), 'field_name' => $name);
if ($objectId) {
if ($object = selector::get('object')->id($objectId)) {
$item_arr['object-id'] = $object->id;
$item_arr['object-name'] = $object->name;
}
}
if ($elementId) {
if ($element = selector::get('element')->id($elementId)) {
$item_arr['element-id'] = $element->id;
$item_arr['element-name'] = $element->name;
$item_arr['element-link'] = $element->link;
}
}
$items_arr[] = self::parseTemplate($tpl_item, $item_arr, false, $objectId);
}
$arr = array('field_id' => $property->getField()->getId(), 'field_name' => $name, 'name' => $name, 'title' => $title, 'subnodes:items' => $items_arr);
return self::parseTemplate($tpl_block, $arr);
}
示例15: calendarIndex
public function calendarIndex($v7552cd149af7495ee7d8225974e50f80, $v972bf3f05d14ffbdb817bef60638ff00, $v84cdc76cabf41bd7c961f6ab12f117d8 = false, $v7436f942d5ea836cb84f1bb2527d8286 = false, $v12a055bf01a31369fe81ac35d85c7bc1 = 1, $v66f6181bcb4cff4cd38fbc804a036db6 = 'default')
{
list($v31912934b8f34be4364cc043cd8a0176, $v4aea309357d3d2b6db2d854df7b2cb21, $v965a7685c914026380d3c7016175e350, $vcd3886ae8293ea7c31578c12fc4e0b8a, $v38d22f83de5454f9463b73ef57e59183) = def_module::loadTemplates("./tpls/calendar/" . $v66f6181bcb4cff4cd38fbc804a036db6, 'calendar', 'week', 'day', 'day_a', 'day_null');
$vb3b32a2d422265cd25c3323ed0157f81 = new selector('pages');
$v7552cd149af7495ee7d8225974e50f80 = def_module::analyzeRequiredPath($v7552cd149af7495ee7d8225974e50f80);
if (!$v7552cd149af7495ee7d8225974e50f80) {
throw new publicException("Page #{$v7552cd149af7495ee7d8225974e50f80} not found");
}
$vb81ca7c0ccaa77e7aa91936ab0070695 = umiHierarchy::getInstance();
$v6301cee35ea764a1e241978f93f01069 = $vb81ca7c0ccaa77e7aa91936ab0070695->getDominantTypeId($v7552cd149af7495ee7d8225974e50f80);
if (!$v6301cee35ea764a1e241978f93f01069) {
return;
}
$vb3b32a2d422265cd25c3323ed0157f81->types('object-type')->id($v6301cee35ea764a1e241978f93f01069);
$vb3b32a2d422265cd25c3323ed0157f81->where('hierarchy')->page($v7552cd149af7495ee7d8225974e50f80)->childs($v12a055bf01a31369fe81ac35d85c7bc1);
try {
$v6a992d5529f459a44fee58c733255e86 = new calendarIndex($vb3b32a2d422265cd25c3323ed0157f81);
$va0e7b2a565119c0a7ec3126a16016113 = $v6a992d5529f459a44fee58c733255e86->index($v972bf3f05d14ffbdb817bef60638ff00, $v84cdc76cabf41bd7c961f6ab12f117d8, $v7436f942d5ea836cb84f1bb2527d8286);
} catch (baseException $ve1671797c52e15f763380b45e841ec32) {
throw new publicException($ve1671797c52e15f763380b45e841ec32->getMessage());
}
$vae60f11ab51860bdb22794a943335a34 = array();
$v659dfac5417796f5351cb780481795fe = ceil((sizeof($va0e7b2a565119c0a7ec3126a16016113['days']) + $va0e7b2a565119c0a7ec3126a16016113['first-day']) / 7);
$vee21496299dbf88355a35db78a7c1e99 = $v659dfac5417796f5351cb780481795fe * 7;
$v79f5fae92f4da5d4ad1eddea50cc575c = null;
$v8e2dcfd7e7e24b1ca76c1193f645902b = selector::get('page')->id($v7552cd149af7495ee7d8225974e50f80);
if ($v8e2dcfd7e7e24b1ca76c1193f645902b) {
$v79f5fae92f4da5d4ad1eddea50cc575c = $v8e2dcfd7e7e24b1ca76c1193f645902b->link;
}
$vd56c863670800e22ac293bb8e275c1a3 = $v6a992d5529f459a44fee58c733255e86->timeStart;
for ($v865c0c0b4ab0e063e5caa3387c1a8741 = 0; $v865c0c0b4ab0e063e5caa3387c1a8741 < $v659dfac5417796f5351cb780481795fe; $v865c0c0b4ab0e063e5caa3387c1a8741++) {
$v44fdec47036f482b68b748f9d786801b = array();
for ($v363b122c528f54df4a0446b6bab05515 = 0; $v363b122c528f54df4a0446b6bab05515 < 7; $v363b122c528f54df4a0446b6bab05515++) {
$vb1bc248a7ff2b2e95569f56de68615df = $v865c0c0b4ab0e063e5caa3387c1a8741 * 7 + $v363b122c528f54df4a0446b6bab05515 - $va0e7b2a565119c0a7ec3126a16016113['first-day'] + 1;
if ($vb1bc248a7ff2b2e95569f56de68615df > sizeof($va0e7b2a565119c0a7ec3126a16016113['days']) || $vb1bc248a7ff2b2e95569f56de68615df <= 0) {
$vb1bc248a7ff2b2e95569f56de68615df = false;
$v4f2afc9c4099ee1f39c9f551123e54bd = $v38d22f83de5454f9463b73ef57e59183;
$ve2942a04780e223b215eb8b663cf5353 = 0;
} else {
$ve2942a04780e223b215eb8b663cf5353 = (int) $va0e7b2a565119c0a7ec3126a16016113['days'][$vb1bc248a7ff2b2e95569f56de68615df];
$v4f2afc9c4099ee1f39c9f551123e54bd = $ve2942a04780e223b215eb8b663cf5353 ? $vcd3886ae8293ea7c31578c12fc4e0b8a : $v965a7685c914026380d3c7016175e350;
}
$v2a304a1348456ccd2234cd71a81bd338 = null;
if ($ve2942a04780e223b215eb8b663cf5353) {
$v83f1535f99ab0bf4e9d02dfd85d3e3f7 = $vd56c863670800e22ac293bb8e275c1a3 + 3600 * 24 * ($vb1bc248a7ff2b2e95569f56de68615df - 1);
$v0f826a89cf68c399c5f4cf320c1a5842 = $v83f1535f99ab0bf4e9d02dfd85d3e3f7 + 3600 * 24;
$v2a304a1348456ccd2234cd71a81bd338 = $v79f5fae92f4da5d4ad1eddea50cc575c . "?fields_filter[{$v972bf3f05d14ffbdb817bef60638ff00}][]={$v83f1535f99ab0bf4e9d02dfd85d3e3f7}&fields_filter[{$v972bf3f05d14ffbdb817bef60638ff00}][]=" . $v0f826a89cf68c399c5f4cf320c1a5842;
}
$v44fdec47036f482b68b748f9d786801b[] = def_module::parseTemplate($v4f2afc9c4099ee1f39c9f551123e54bd, array('@count' => $ve2942a04780e223b215eb8b663cf5353, '@link' => $v2a304a1348456ccd2234cd71a81bd338, '#day' => $vb1bc248a7ff2b2e95569f56de68615df));
}
$v172a8327fcd3685ab3c0f740d031da09 = array('void:days' => $v44fdec47036f482b68b748f9d786801b, 'nodes:day' => $v44fdec47036f482b68b748f9d786801b);
$vae60f11ab51860bdb22794a943335a34[] = def_module::parseTemplate($v4aea309357d3d2b6db2d854df7b2cb21, $v172a8327fcd3685ab3c0f740d031da09);
}
return def_module::parseTemplate($v31912934b8f34be4364cc043cd8a0176, array('date' => $v6a992d5529f459a44fee58c733255e86->timeStart, 'year' => $va0e7b2a565119c0a7ec3126a16016113['year'], 'month' => $va0e7b2a565119c0a7ec3126a16016113['month'], 'void:weeks' => $vae60f11ab51860bdb22794a943335a34, 'nodes:week' => $vae60f11ab51860bdb22794a943335a34));
}