當前位置: 首頁>>代碼示例>>PHP>>正文


PHP selector類代碼示例

本文整理匯總了PHP中selector的典型用法代碼示例。如果您正苦於以下問題:PHP selector類的具體用法?PHP selector怎麽用?PHP selector使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了selector類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的selector類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。