本文整理汇总了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);
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
示例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);
}
示例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;
}
示例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();
}