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

PHP selector类代码示例

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

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



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

示例1: 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


示例2: 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


示例3: 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


示例4: 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


示例5: 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


示例6: 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


示例7: 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


示例8: export

 public function export($v01af57e4ae6d799566f5695b3679756b)
 {
     $v8be74552df93e31bbdd6b36ed74bdb6a = new selector('pages');
     if (is_array($v01af57e4ae6d799566f5695b3679756b) && count($v01af57e4ae6d799566f5695b3679756b)) {
         foreach ($v01af57e4ae6d799566f5695b3679756b as $ve730db5c29b7ba34f4d465b01bd33c5e) {
             $v8be74552df93e31bbdd6b36ed74bdb6a->where('hierarchy')->page($ve730db5c29b7ba34f4d465b01bd33c5e->getId())->childs(100);
         }
     } else {
         $v8be74552df93e31bbdd6b36ed74bdb6a->where('hierarchy')->page(0)->childs(100);
     }
     $v6a7f245843454cf4f28ad7c5e2572aa2 = array_merge($v8be74552df93e31bbdd6b36ed74bdb6a->result, $v01af57e4ae6d799566f5695b3679756b);
     $vbbd738a112791dd1d0cb6bd0d61d878f = $this->getUmiDump($v6a7f245843454cf4f28ad7c5e2572aa2);
     return $vbbd738a112791dd1d0cb6bd0d61d878f;
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:14,代码来源:umiDumpExporter.php


示例9: 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


示例10: 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


示例11: places

 public function places()
 {
     $mode = (string) getRequest('param0');
     if ($mode == "do") {
         $this->saveEditedList("objects", array('type' => 'place'));
         $this->chooseRedirect();
     }
     $sel = new selector('objects');
     $sel->types('object-type')->name('banners', 'place');
     $this->setDataType("list");
     $this->setActionType("modify");
     $data = $this->prepareData($sel->result, "objects");
     $this->setData($data, $sel->length);
     return $this->doData();
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:15,代码来源:__places.php


示例12: getSystemEventRecipients

 public function getSystemEventRecipients()
 {
     $permissions = permissionsCollection::getInstance();
     $currentUserId = $permissions->getUserId();
     $sel = new selector('objects');
     $sel->types('object-type')->name('users', 'user');
     $sel->where('groups')->equals(SV_GROUP_ID);
     $result = array(SV_USER_ID);
     foreach ($sel as $user) {
         if ($user->id != $currentUserId) {
             $result[] = $user->id;
         }
     }
     return $result;
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:15,代码来源:__mess_events.php


示例13: 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);
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:34,代码来源:__profile.php


示例14: getCustomerOrders

 protected function getCustomerOrders()
 {
     static $customerOrders = null;
     if (!is_null($customerOrders)) {
         return $customerOrders;
     }
     $customer = customer::get();
     $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->where('status_id')->equals(order::getStatusByCode('ready'));
     return $customerOrders = $sel->result;
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:17,代码来源:allOrdersPrices.php


示例15: 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


示例16: show_user_orders

 /**
  * Функция рисует список заказов пользователя
  * @param string $template Название шаблона
  * @return mixed Список заказов пользователя
  */
 public function show_user_orders($template = 'default')
 {
     list($tpl_block, $tpl_block_empty, $tpl_item, $tpl_order_item) = def_module::loadTemplates("emarket/" . $template, 'orders_block', 'orders_block_empty', 'orders_item', 'orders_order_item');
     $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::get()->id);
     $sel->where('name')->isNull(false);
     $sel->where('domain_id')->equals($domainId);
     if ($sel->length == 0) {
         $tpl_block = $tpl_block_empty;
     }
     $items_arr = array();
     foreach ($sel->result as $selOrder) {
         $order = order::get($selOrder->id);
         $item_arr['attribute:id'] = $order->id;
         $item_arr['attribute:name'] = $order->name;
         $item_arr['attribute:type-id'] = $order->typeId;
         $item_arr['attribute:guid'] = $order->GUID;
         $item_arr['attribute:type-guid'] = $order->typeGUID;
         $item_arr['attribute:ownerId'] = $order->ownerId;
         $item_arr['xlink:href'] = $order->xlink;
         $item_arr['attribute:delivery_allow_date'] = date('d.m.Y', $order->getValue('delivery_allow_date')->timestamp);
         //print_r($order->getValue('order_items'));
         //Получаем список товаров заказа
         $items = array();
         foreach ($order->getItems() as $orderItem) {
             //					print_r($order_item); die;
             $item_line = array();
             //					print_r(umiHierarchy::getInstance()->getObjectInstances($orderItem->id));
             $item_line['attribute:element_id'] = $orderItem->id;
             $item_line['attribute:name'] = $orderItem->name;
             $item_line['attribute:item_amount'] = $orderItem->getAmount();
             //					$item_line['attribute:options'] = $orderItem->getOptions();
             //						print_r($order_item->options);
             $items[] = def_module::parseTemplate($tpl_order_item, $item_line, false, $iOrderItemId);
             umiObjectsCollection::getInstance()->unloadObject($iOrderItemId);
         }
         $item_arr['subnodes:order_items'] = $items;
         $items_arr[] = def_module::parseTemplate($tpl_item, $item_arr, false, $order->id);
     }
     return def_module::parseTemplate($tpl_block, array('subnodes:items' => $items_arr));
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:50,代码来源:__custom.php


示例17: export

 public function export($v92ec19ffde05e15769b1bb3ee05ad745)
 {
     if (!count($v92ec19ffde05e15769b1bb3ee05ad745)) {
         $v8be74552df93e31bbdd6b36ed74bdb6a = new selector('pages');
         $v8be74552df93e31bbdd6b36ed74bdb6a->where('hierarchy')->page(0)->childs(0);
         $v92ec19ffde05e15769b1bb3ee05ad745 = $v8be74552df93e31bbdd6b36ed74bdb6a->result();
     }
     $vbbd738a112791dd1d0cb6bd0d61d878f = $this->getUmiDump($v92ec19ffde05e15769b1bb3ee05ad745, "commerceML2");
     $vd0c75bac742760cf71fd76cd75d0c02a = './xsl/export/' . $this->type . '.xsl';
     if (!is_file($vd0c75bac742760cf71fd76cd75d0c02a)) {
         throw new publicException("Can't load exporter {$vd0c75bac742760cf71fd76cd75d0c02a}");
     }
     $v9a09b4dfda82e3e665e31092d1c3ec8d = new DOMDocument("1.0", "utf-8");
     $v9a09b4dfda82e3e665e31092d1c3ec8d->formatOutput = XML_FORMAT_OUTPUT;
     $v9a09b4dfda82e3e665e31092d1c3ec8d->loadXML($vbbd738a112791dd1d0cb6bd0d61d878f);
     $v640eac53ad75db5c49a9ec86390d8530 = umiTemplater::create('XSLT', $vd0c75bac742760cf71fd76cd75d0c02a);
     return $v640eac53ad75db5c49a9ec86390d8530->parse($v9a09b4dfda82e3e665e31092d1c3ec8d);
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:18,代码来源:catalogCommerceMLExporter.php


示例18: checkAllMessages

 public function checkAllMessages()
 {
     $service = antiSpamService::get();
     if (!$service) {
         return;
     }
     $sel = new selector('pages');
     $sel->types->name('comments', 'comment');
     $sel->types->name('forum', 'message');
     $sel->where('is_spam')->isNull();
     foreach ($sel->result() as $page) {
         $service->setNick(null);
         $service->setLink($page->link);
         $service->setContent($page->content);
         $page->is_spam = $service->isSpam() ? 2 : 1;
         $page->commit();
     }
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:18,代码来源:__antispam.php


示例19: export

 public function export($v01af57e4ae6d799566f5695b3679756b)
 {
     $v8be74552df93e31bbdd6b36ed74bdb6a = new selector('objects');
     $v8be74552df93e31bbdd6b36ed74bdb6a->types('object-type')->name('emarket', 'order');
     $v8be74552df93e31bbdd6b36ed74bdb6a->where('need_export')->equals(1);
     $vbbd738a112791dd1d0cb6bd0d61d878f = $this->getUmiDumpObjects($v8be74552df93e31bbdd6b36ed74bdb6a->result, "CommerceML2");
     $vd0c75bac742760cf71fd76cd75d0c02a = './xsl/export/' . $this->type . '.xsl';
     if (!is_file($vd0c75bac742760cf71fd76cd75d0c02a)) {
         throw new publicException("Can't load exporter {$vd0c75bac742760cf71fd76cd75d0c02a}");
     }
     $v9a09b4dfda82e3e665e31092d1c3ec8d = new DOMDocument("1.0", "utf-8");
     $v9a09b4dfda82e3e665e31092d1c3ec8d->formatOutput = XML_FORMAT_OUTPUT;
     $v9a09b4dfda82e3e665e31092d1c3ec8d->loadXML($vbbd738a112791dd1d0cb6bd0d61d878f);
     $v640eac53ad75db5c49a9ec86390d8530 = umiTemplater::create('XSLT', $vd0c75bac742760cf71fd76cd75d0c02a);
     $result = $v640eac53ad75db5c49a9ec86390d8530->parse($v9a09b4dfda82e3e665e31092d1c3ec8d);
     $result = str_replace('<?xml version="1.0" encoding="utf-8"?>', '<?xml version="1.0" encoding="windows-1251"?>', $result);
     $result = iconv("UTF-8", "CP1251//IGNORE", $result);
     return $result;
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:19,代码来源:ordersCommerceMLExporter.php


示例20: 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;
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:10,代码来源:systemDomain.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP self类代码示例发布时间:2022-05-23
下一篇:
PHP select类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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