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


PHP selector::types方法代码示例

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


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

示例1: detectFilters

 static function detectFilters(selector $v8be74552df93e31bbdd6b36ed74bdb6a)
 {
     if ($v8be74552df93e31bbdd6b36ed74bdb6a->mode == 'pages') {
         $ve4e46deb7f9cc58c7abfb32e5570b6f3 = (array) getRequest('domain_id');
         foreach ($ve4e46deb7f9cc58c7abfb32e5570b6f3 as $v72ee76c5c29383b7c9f9225c1fa4d10b) {
             $v8be74552df93e31bbdd6b36ed74bdb6a->where('domain')->equals($v72ee76c5c29383b7c9f9225c1fa4d10b);
         }
         $v5a05866850c28651fe234659f6c92ada = (array) getRequest('lang_id');
         foreach ($v5a05866850c28651fe234659f6c92ada as $vf585b7f018bb4ced15a03683a733e50b) {
             $v8be74552df93e31bbdd6b36ed74bdb6a->where('lang')->equals($vf585b7f018bb4ced15a03683a733e50b);
         }
     }
     if ($v8be74552df93e31bbdd6b36ed74bdb6a->mode == 'pages' && sizeof($v8be74552df93e31bbdd6b36ed74bdb6a->types) && is_array(getRequest('rel')) && regedit::getInstance()->getVal('//modules/comments')) {
         $v8be74552df93e31bbdd6b36ed74bdb6a->types('hierarchy-type')->name('comments', 'comment');
     }
     if (isset($_REQUEST['hierarchy_types'])) {
         $vc7fcb1af65c062d638abb298ceddb52b = (array) $_REQUEST['hierarchy_types'];
         foreach ($vc7fcb1af65c062d638abb298ceddb52b as $v9e3669d19b675bd57058fd4664205d2a) {
             $v9e3669d19b675bd57058fd4664205d2a = explode('-', $v9e3669d19b675bd57058fd4664205d2a);
             if (sizeof($v9e3669d19b675bd57058fd4664205d2a) == 2) {
                 $v8be74552df93e31bbdd6b36ed74bdb6a->types('hierarchy-type')->name($v9e3669d19b675bd57058fd4664205d2a[0], $v9e3669d19b675bd57058fd4664205d2a[1]);
             }
         }
     }
     self::detectHierarchyFilters($v8be74552df93e31bbdd6b36ed74bdb6a);
     self::detectWhereFilters($v8be74552df93e31bbdd6b36ed74bdb6a);
     self::detectOrderFilters($v8be74552df93e31bbdd6b36ed74bdb6a);
     self::checkSyncParams($v8be74552df93e31bbdd6b36ed74bdb6a);
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:29,代码来源:helper.php

示例2: getByCodeName

		public static function getByCodeName($code) {
			$sel = new selector('objects');
			$sel->types('object-type')->name('social_networks','network');
			$sel->where('social_id')->equals($code);

			return self::get($sel->first);
		}
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:7,代码来源:network.php

示例3: merge

		/**
			* Слить все заказы покупателя в профиль пользователя.
			* Объект покупателя после этого будет уничтожен
		*/
		public function merge(umiObject $customer) {

			$cmsController = cmsController::getInstance();
			$domain = $cmsController->getCurrentDomain();
			$domainId = $domain->getId();

			$sel = new selector('objects');
			$sel->types('object-type')->name('emarket', 'order');
			$sel->where('customer_id')->equals($customer->id);
			$sel->where('domain_id')->equals($domainId);
			$sel->order('id')->desc();

			$permissions = permissionsCollection::getInstance();
			$userId = $permissions->getUserId();

			foreach($sel as $order) {
				if(!$order->status_id) {
					$this->mergeBasket($order);
					continue;
				}

				$order->customer_id = $userId;
				$order->commit();
			}
			if (!defined('UMICMS_CLI_MODE') || !UMICMS_CLI_MODE) {
				setcookie('customer-id', 0, 1, '/');
			}
			$customer->delete();
		}
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:33,代码来源:customer.php

示例4: orders

 public function orders()
 {
     $this->setDataType("list");
     $this->setActionType("view");
     if ($this->ifNotXmlMode()) {
         return $this->doData();
     }
     $limit = getRequest('per_page_limit');
     $curr_page = (int) getRequest('p');
     $offset = $limit * $curr_page;
     $sel = new selector('objects');
     $sel->types('object-type')->name('emarket', 'order');
     $sel->where('status_id')->isNull(false);
     $sel->where('name')->notequals('dummy');
     $sel->limit($offset, $limit);
     if (!getRequest('order_filter')) {
         $sel->order('order_date')->desc();
     }
     selectorHelper::detectFilters($sel);
     $domains = getRequest('domain_id');
     if (is_array($domains) && sizeof($domains)) {
         $domainsCollection = domainsCollection::getInstance();
         if (sizeof($domainsCollection->getList()) > 1) {
             $sel->where('domain_id')->equals($domains[0]);
         }
     }
     $this->setDataRange($limit, $offset);
     $data = $this->prepareData($sel->result, "objects");
     $this->setData($data, $sel->length);
     return $this->doData();
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:31,代码来源:__admin_orders.php

示例5: createAuthorGuest

 public function createAuthorGuest($nick, $email, $ip)
 {
     $objects = umiObjectsCollection::getInstance();
     $objectTypes = umiObjectTypesCollection::getInstance();
     $nick = trim($nick);
     $email = trim($email);
     if (!$nick) {
         $nick = getLabel('author-anonymous');
     }
     if (!$email) {
         $email = getServer('REMOTE_ADDR');
     }
     $sel = new selector('objects');
     $sel->types('object-type')->name('users', 'author');
     $sel->where('email')->equals($email);
     $sel->where('nickname')->equals($nick);
     $sel->where('ip')->equals($ip);
     $sel->limit(0, 1);
     if ($sel->first) {
         return $sel->first->id;
     } else {
         $user_name = $nick . " ({$email})";
         $object_type_id = $objectTypes->getBaseType("users", "author");
         $author_id = $objects->addObject($user_name, $object_type_id);
         $author = $objects->getObject($author_id);
         $author->name = $user_name;
         $author->is_registrated = false;
         $author->nickname = $nick;
         $author->email = $email;
         $author->ip = $ip;
         $author->commit();
         return $author_id;
     }
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:34,代码来源:__author.php

示例6: getList

 public static function getList($discountTypeId = false)
 {
     $objectTypeId = self::getRuleType()->getId();
     $sel = new selector('objects');
     $sel->types('object-type')->id($objectTypeId);
     if ($discountTypeId) {
         $sel->where('rule_discount_types')->equals($discountTypeId);
     }
     return $sel->result();
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:10,代码来源:discountRule.php

示例7: onDispatchChanges

		public function onDispatchChanges(iUmiEventPoint $oEvent) {
			$sTemplate = "default";

			try {
				list($sTemplateSubject, $sTemplateMessage) = def_module::loadTemplatesForMail("forum/mails/".$sTemplate, "mail_subject", "mail_message");
			} catch (publicException $e) {
				return false;
			}

			$iTopicId = $oEvent->getParam("topic_id");
			$iMessageId = $oEvent->getParam("message_id");
			$message = umiHierarchy::getInstance()->getElement($iMessageId);

			$sel = new selector('objects');
			$sel->types('object-type')->name("users", "user");
			$sel->where('subscribed_pages')->equals($iTopicId);
			
			if (!$sel->length()) return false;

			$hierarchy = umiHierarchy::getInstance();

			$block_arr = Array();

			$sTemplateSubject = def_module::parseTemplateForMail($sTemplateSubject, $block_arr, $iMessageId);
			
			$sFromEmail = regedit::getInstance()->getVal("//settings/email_from");
			$sFromFio = regedit::getInstance()->getVal("//settings/fio_from");

			$oMail = new umiMail();
			$oMail->setFrom($sFromEmail, $sFromFio);
			$oMail->setSubject($sTemplateSubject);

			foreach($sel->result() as $oUser) {
				$oMailUser = clone $oMail;
				$sUserMail = $oUser->getValue('e-mail');
				$block_arr['h1'] = $message->getValue('h1');
				$block_arr['message'] = $message->getValue('message');

				$hierarchy->forceAbsolutePath(true);
				$block_arr['unsubscribe_link'] = $hierarchy->getPathById($iTopicId) . "?unsubscribe=" . base64_encode($iUserId);
				$sTemplateMessageUser = def_module::parseTemplateForMail($sTemplateMessage, $block_arr, $iMessageId);
				$oMailUser->setContent($sTemplateMessageUser);
				$hierarchy->forceAbsolutePath(false);

				if (umiMail::checkEmail($sUserMail)) {
					$sUserFio = $oUser->getValue('lname') . " ". $oUser->getValue('fname') . " " . $oUser->getValue('father_name');
					$oMailUser->addRecipient($sUserMail, $sUserFio);
					$oMailUser->commit();
					$oMailUser->send();
				}
				else continue;
			}
			return true;
		}
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:54,代码来源:__sysevents.php

示例8: lists

 public function lists()
 {
     $this->setDataType("list");
     $this->setActionType("view");
     if ($this->ifNotXmlMode()) {
         return $this->doData();
     }
     $limit = getRequest('per_page_limit');
     $curr_page = getRequest('p');
     $offset = $curr_page * $limit;
     $sel = new selector('pages');
     $sel->types('hierarchy-type')->name('news', 'rubric');
     $sel->types('hierarchy-type')->name('news', 'item');
     $sel->limit($offset, $limit);
     selectorHelper::detectFilters($sel);
     $data = $this->prepareData($sel->result, "pages");
     $this->setData($data, $sel->length);
     $this->setDataRangeByPerPage($limit, $curr_page);
     return $this->doData();
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:20,代码来源:__admin.php

示例9: customContent

function customContent($page, &$vars)
{
    $items = new \selector('pages');
    $items->types('hierarchy-type')->name('content', 'page');
    $items->where('hierarchy')->page($page->id)->childs(1);
    $pages = array();
    foreach ($items as $item) {
        $p = array('id' => $item->id, 'name' => $item->getName(), 'content' => $item->getValue('content'));
        $pages[] = $p;
    }
    $vars['vacancies'] = $pages;
}
开发者ID:sd-studio,项目名称:nz,代码行数:12,代码来源:vacancies.php

示例10: number

 public function number()
 {
     $sel = new selector('objects');
     $sel->types('object-type')->name('emarket', 'order');
     $sel->order('number')->desc();
     $sel->limit(0, 1);
     $number = $sel->first ? $sel->first->number + 1 : 1;
     $order = $this->order;
     $order->name = getLabel('order-name-prefix', 'emarket', $number);
     $order->number = $number;
     $order->commit();
     return $number;
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:13,代码来源:default.php

示例11: search_by_size

 public function search_by_size()
 {
     $pages = new selector('objects');
     $pages->types('object-type')->name('guide', 'guide');
     $pages->where('id')->equals('125');
     //$pages->limit(0,3);
     $res = '';
     foreach ($pages as $page) {
         print_r($page);
         die;
     }
     return $res;
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:13,代码来源:__custom.php

示例12: getReleaseMessages

		public function getReleaseMessages($iReleaseId = false) {
			$iHierarchyTypeId = umiHierarchyTypesCollection::getInstance()->getTypeByName("dispatches", "message")->getId();
			$iMsgTypeId =  umiObjectTypesCollection::getInstance()->getTypeByHierarchyTypeId($iHierarchyTypeId);
			$oMsgType = umiObjectTypesCollection::getInstance()->getType($iMsgTypeId);

			$sel = new selector('objects');
			$sel->types('object-type')->name('dispatches', 'message');
			if($iReleaseId) {
				$sel->where('release_reference')->equals($iReleaseId);
			}
			selectorHelper::detectFilters($sel);
			return $sel->result;
		}
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:13,代码来源:__messages.php

示例13: images

 public static function images($albumId)
 {
     $photos = new selector('pages');
     $photos->types('hierarchy-type')->name('photoalbum', 'photo');
     $photos->where('hierarchy')->page($albumId)->childs(1);
     $images = array();
     foreach ($photos as $photo) {
         $image = $photo->getObject()->getPropByName('photo')->getValue();
         if ($image) {
             $images[] = array('id' => $photo->id, 'name' => $photo->getName(), 'link' => $image->getFilePath(true));
         }
     }
     return $images;
 }
开发者ID:sd-studio,项目名称:nz,代码行数:14,代码来源:gallery.php

示例14: clearPrimary

 public static function clearPrimary($except = 0)
 {
     $sel = new selector('objects');
     $sel->types('object-type')->name('emarket', 'store');
     $stores = $sel->result;
     foreach ($stores as $v) {
         if ($except == $v->getId()) {
             continue;
         }
         $v->setValue('primary', 0);
         $v->commit();
     }
     return true;
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:14,代码来源:stores.php

示例15: lists

 public function lists()
 {
     // Установить формат вывода list
     // Устанавливаем действие над списокм - "view" - просмотр списка
     $this->setDataType("list");
     $this->setActionType("view");
     // если не XmlMode то выдоча того что есть
     if ($this->ifNotXmlMode()) {
         return $this->doData();
     }
     // Установить лимит в 20
     $limit = 20;
     /**
     * Обратите внимание!
     * Эта строка необходима для корректного определения 
     * текущей страницы
     		Возвращает параметр из $_SERVER['QUERY_STRING']
     */
     $curr_page = getRequest('p');
     // вычисляем смещение от начала списка
     $offset = $curr_page * $limit;
     // Установить параметры выборки
     // Выбирать страницы связанных с методами groupelements и item_element
     // Установить лимит Смещение от начала списка и количество страниц
     $sel = new selector('pages');
     $sel->types('hierarchy-type')->name('modulelements', 'groupelements');
     $sel->types('hierarchy-type')->name('modulelements', 'item_element');
     $sel->limit($offset, $limit);
     // ? Очевидно какой-нибудь фильтр
     selectorHelper::detectFilters($sel);
     // Подготавливаем данные, чтобы потом корректно их вывести
     $data = $this->prepareData($sel->result, "pages");
     // Данные, длинна
     $this->setData($data, $sel->length);
     $this->setDataRangeByPerPage($limit, $curr_page);
     return $this->doData();
 }
开发者ID:tomoonshine,项目名称:postsms,代码行数:37,代码来源:__admin.php


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