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

PHP eq函数代码示例

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

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



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

示例1: getEmail

 /**
  * Displays the form to allow a user to enter their email
  *
  * @param Request $request
  * @return \Illuminate\View\View
  */
 public function getEmail(Request $request)
 {
     if (eq($request->segment(1), 'backend')) {
         return view('backend.auth.forgot_password');
     }
     return view('auth.forgot_password');
 }
开发者ID:muhamadsyahril,项目名称:ecommerce-1,代码行数:13,代码来源:PasswordController.php


示例2: move

 /**
  * @role update
  */
 public function move()
 {
     $page = StaticPage::getInstanceById((int) $this->request->get('id'), StaticPage::LOAD_DATA);
     // update parent
     if ($this->request->get('parent')) {
         $parent = StaticPage::getInstanceById((int) $this->request->get('parent'), StaticPage::LOAD_DATA);
     } else {
         $parent = null;
     }
     $page->parent->set($parent);
     $page->save();
     // update order
     $f = new ARUpdateFilter();
     if ($parent) {
         $f->setCondition(eq(f('StaticPage.parentID'), $parent->getID()));
     } else {
         $f->setCondition(new IsNullCond(f('StaticPage.parentID')));
     }
     $f->addModifier('StaticPage.position', new ARExpressionHandle('position+2'));
     if ($this->request->get('previous')) {
         $previous = StaticPage::getInstanceById((int) $this->request->get('previous'), StaticPage::LOAD_DATA);
         $position = $previous->position->get();
         $f->mergeCondition(gt(f('StaticPage.position'), $position));
         $page->position->set($position + 1);
     } else {
         $previous = null;
         $page->position->set(1);
     }
     ActiveRecordModel::updateRecordSet('StaticPage', $f);
     $page->save();
     return new JSONResponse(array(), 'success', $this->translate('_pages_were_successfully_reordered'));
 }
开发者ID:saiber,项目名称:livecart,代码行数:35,代码来源:StaticPageController.php


示例3: __construct

 /**
  * @param AuthenticateUser $authenticateUser
  * @param Request $request
  */
 public function __construct(AuthenticateUser $authenticateUser, Request $request)
 {
     $this->middleware('guest', ['except' => 'getLogout', 'getActivate']);
     $this->auth = $authenticateUser;
     $this->request = $request;
     $this->backend = eq($request->segment(1), 'backend') ? true : false;
 }
开发者ID:muhamadsyahril,项目名称:ecommerce-1,代码行数:11,代码来源:AuthController.php


示例4: testRunStar

 public function testRunStar()
 {
     $result = runStar(function ($q, $r) {
         return disjPlus(eq($q, 2), eq($q, 3), eq($q, 4));
     });
     $this->assertEquals('(2 . (3 . (4)))', sprintf('%s', $result));
 }
开发者ID:mudge,项目名称:php-microkanren,代码行数:7,代码来源:MiniTest.php


示例5: getInstance

 public static function getInstance(OrderedItem $item, ProductFile $file)
 {
     $instance = $item->getRelatedRecordSet('OrderedFile', select(eq('OrderedFile.productFileID', $file->getID())))->shift();
     if (!$instance) {
         $instance = self::getNewInstance($item, $file);
     }
     return $instance;
 }
开发者ID:saiber,项目名称:livecart,代码行数:8,代码来源:OrderedFile.php


示例6: testSecondSetT2

 public function testSecondSetT2()
 {
     $x = callFresh(function ($q) {
         return eq($q, 5);
     });
     $result = $x(emptyState());
     $this->assertEquals('()', sprintf('%s', cdr($result)));
 }
开发者ID:mudge,项目名称:php-microkanren,代码行数:8,代码来源:CoreTest.php


示例7: getRecordCount

 public static function getRecordCount($locale = null)
 {
     $filter = new ARSelectFilter();
     if ($locale) {
         $filter->mergeCondition(eq(f(__CLASS__ . '.locale'), $locale));
     }
     return ActiveRecordModel::getRecordCount(__CLASS__, $filter);
 }
开发者ID:saiber,项目名称:livecart,代码行数:8,代码来源:SearchableItem.php


示例8: loadDefaultImage

 private function loadDefaultImage()
 {
     if (!isset($this->object['DefaultImage']) && isset($this->object['defaultImageID'])) {
         $defaultImageArray = ActiveRecordModel::getRecordSetArray('ProductImage', select(eq(f('ProductImage.ID'), $this->object['defaultImageID'])));
         if (count($defaultImageArray) > 0) {
             $this->object['DefaultImage'] = array_merge(current($defaultImageArray), array('Product' => ActiveRecord::getArrayData('Product-' . $this->object['ID'])));
         }
     }
 }
开发者ID:saiber,项目名称:www,代码行数:9,代码来源:SeoProduct.php


示例9: getSelectFilter

 protected function getSelectFilter()
 {
     if (!$this->selectFilter) {
         $this->selectFilter = select(eq('CustomerOrder.isFinalized', true), isnotnull('CustomerOrder.invoiceNumber'));
         $this->selectFilter->setOrder(f('CustomerOrder.dateCompleted'), 'DESC');
         $this->selectFilter->setLimit(1);
     }
     return $this->selectFilter;
 }
开发者ID:saiber,项目名称:livecart,代码行数:9,代码来源:SequentialInvoiceNumber.php


示例10: getPastOrders

 public function getPastOrders()
 {
     if (!is_null($this->pastOrders)) {
         return $this->pastOrders;
     }
     if (!$this->user) {
         return array();
     }
     $sessionUser = SessionUser::getUser();
     if ($this->isSessionCacheUsable()) {
         $session = new Session();
         $sessionHandler = ActiveRecordModel::getApplication()->getSessionHandler();
         $pastOrders = $session->get('pastOrders');
         if (!$pastOrders || $pastOrders['cacheUpdated'] != $sessionHandler->getCacheUpdateTime()) {
             unset($pastOrders);
         }
     }
     if (empty($pastOrders)) {
         $f = select(eq('CustomerOrder.userID', $this->user->getID()), eq('CustomerOrder.isFinalized', true), eq('CustomerOrder.isCancelled', 0), eq('CustomerOrder.isPaid', true));
         $f->setOrder(f('OrderedItem.customerOrderID'), 'DESC');
         $records = ActiveRecordModel::getRecordSetArray('OrderedItem', $f, array('CustomerOrder', 'Product'));
         // load variation parent products separately
         $parentIDs = array();
         foreach ($records as $record) {
             if ($record['Product']['parentID']) {
                 //$parentIDs[$record['Product']['parentID']] = true;
             }
         }
         if ($parentIDs) {
             $parents = array();
             foreach (ActiveRecordModel::getRecordSetArray('Product', select(in('Product.ID', array_keys($parentIDs)))) as $parent) {
                 $parents[$parent['ID']] = $parent;
             }
             foreach ($records as &$record) {
                 if ($record['Product']['parentID']) {
                     $record['Product']['Parent'] = $parents[$record['Product']['parentID']];
                 }
             }
         }
         // split records by orders
         $orders = array();
         foreach ($records as $record) {
             $orders[$record['customerOrderID']][] = $record;
         }
         $pastOrders = array();
         foreach ($orders as $order) {
             $pastOrders[] = new RuleOrderContainer($order);
         }
         $pastOrders = array('cacheUpdated' => time(), 'orders' => $pastOrders);
     }
     if ($this->isSessionCacheUsable()) {
         $session->set('pastOrders', $pastOrders);
         $sessionHandler->updateCacheTimestamp();
     }
     $this->pastOrders = $pastOrders;
     return $this->pastOrders;
 }
开发者ID:saiber,项目名称:livecart,代码行数:57,代码来源:BusinessRuleContext.php


示例11: getInstanceByDateTime

 public static function getInstanceByDateTime($date, $time)
 {
     $f = new ARSelectFilter();
     $f->setCondition(new AndChainCondition(array(eq(f('EyeExamSchedule.date'), $date), eq(f('EyeExamSchedule.time'), $time), isnull(f('EyeExamSchedule.eyeExamRequestID')))));
     $s = self::getRecordSet('EyeExamSchedule', $f);
     if (!$s->size()) {
         return null;
     }
     return $s->get(0);
 }
开发者ID:saiber,项目名称:www,代码行数:10,代码来源:EyeExamSchedule.php


示例12: getThemeByProduct

 public static function getThemeByProduct(Product $product)
 {
     $c = eq(__CLASS__ . '.productID', $product->getID());
     $c->addOr(self::getCategoryCondition($product->getCategory()));
     $f = select($c);
     $f->setOrder(new ARExpressionHandle('CategoryPresentation.productID=' . $product->getID()), 'DESC');
     self::setCategoryOrder($product->getCategory(), $f);
     // check if a theme is defined for this product particularly
     $set = ActiveRecordModel::getRecordSet(__CLASS__, $f, array('Category'));
     return self::getInheritedConfig($set);
 }
开发者ID:saiber,项目名称:www,代码行数:11,代码来源:CategoryPresentation.php


示例13: contains

 /**
  * Tests whether the specified comparable object
  * is in this binary search tree.
  *
  * @param object IComparable $obj The object for which to look.
  * @return boolean True if the specified object
  * is in this binary search tree; false otherwise.
  */
 public function contains(IComparable $obj)
 {
     if ($this->isEmpty()) {
         return false;
     } elseif (eq($obj, $this->getKey())) {
         return true;
     } elseif (lt($obj, $this->getKey())) {
         return $this->getLeft()->contains($obj);
     } else {
         return $this->getRight()->contains($obj);
     }
 }
开发者ID:EdenChan,项目名称:Instances,代码行数:20,代码来源:BinarySearchTree.php


示例14: news

 public function news()
 {
     $this->shouldBeEnabledFeed('NEWS_POSTS');
     $this->setLayout('empty');
     $response = new XMLResponse();
     $f = select(eq(f('NewsPost.isEnabled'), true));
     $f->setLimit($this->config->get('NUMBER_OF_NEWS_POSTS_TO_INCLUDE'));
     $f->setOrder(f('NewsPost.position'), ARSelectFilter::ORDER_DESC);
     $response->set('feed', ActiveRecordModel::getRecordSetArray('NewsPost', $f));
     $this->application->getLocale()->translationManager()->loadFile('News');
     return $response;
 }
开发者ID:saiber,项目名称:livecart,代码行数:12,代码来源:RssController.php


示例15: addCategory

 public function addCategory()
 {
     $category = Category::getInstanceByID($this->request->get('id'), ActiveRecord::LOAD_DATA, array('Category'));
     $relatedCategory = Category::getInstanceByID($this->request->get('categoryId'), ActiveRecord::LOAD_DATA);
     // check if the category is not assigned to this category already
     $f = select(eq('CategoryRelationship.relatedCategoryID', $relatedCategory->getID()));
     if ($category->getRelatedRecordSet('CategoryRelationship', $f)->size()) {
         return new JSONResponse(false, 'failure', $this->translate('_err_already_assigned'));
     }
     $relation = CategoryRelationship::getNewInstance($category, $relatedCategory);
     $relation->save();
     $relatedCategory->getPathNodeSet();
     return new JSONResponse(array('data' => $relation->toFlatArray()));
 }
开发者ID:saiber,项目名称:livecart,代码行数:14,代码来源:CategoryRelationshipController.php


示例16: get

 public function get()
 {
     $request = $this->application->getRequest();
     $products = ActiveRecordModel::getRecordSetArray('Product', select(eq(f('Product.sku'), $request->get('SKU'))), array('Category', 'Manufacturer', 'ProductImage'));
     if (count($products) == 0) {
         throw new Exception('Product not found');
     }
     // --
     $response = new LiveCartSimpleXMLElement('<response datetime="' . date('c') . '"></response>');
     $responseProduct = $response->addChild('product');
     while ($product = array_shift($products)) {
         $this->fillResponseItem($responseProduct, $product);
     }
     return new SimpleXMLResponse($response);
 }
开发者ID:saiber,项目名称:livecart,代码行数:15,代码来源:ProductApi.php


示例17: getSelectFilter

 public function getSelectFilter($searchTerm)
 {
     // create initial index
     if (0 && !SearchableItem::getRecordCount()) {
         $app = ActiveRecordModel::getApplication();
         $sc = new SearchableConfigurationIndexing($app->getConfig(), $app);
         $sc->buildIndex(null);
     }
     $c = new ARExpressionHandle($this->getWeighedSearchCondition(array('value' => 1), $searchTerm));
     $app = ActiveRecordModel::getApplication();
     $f = new ARSelectFilter(new MoreThanCond($c, 0));
     $f->mergeCondition(new OrChainCondition(array(eq(f('SearchableItem.locale'), $app->getDefaultLanguageCode()), eq(f('SearchableItem.locale'), $app->getLocaleCode()), isnull(f('SearchableItem.locale')))));
     $f->setOrder(f('SearchableItem.sort'), 'DESC');
     $f->setOrder($c, 'DESC');
     return $f;
 }
开发者ID:saiber,项目名称:www,代码行数:16,代码来源:SearchableConfiguration.php


示例18: insert

 /**
  * Inserts the specified object into this B-tree.
  *
  * @param object IComparable $obj The object to insert.
  */
 public function insert(IComparable $obj)
 {
     if ($this->isEmpty()) {
         if ($this->parent === NULL) {
             $this->attachSubtree(0, new BTree($this->getM()));
             $this->key[1] = $obj;
             $this->attachSubtree(1, new BTree($this->getM()));
             $this->count = 1;
         } else {
             $this->parent->insertPair($obj, new BTree($this->getM()));
         }
     } else {
         $index = $this->findIndex($obj);
         if ($index != 0 && eq($object, $this->key[$index])) {
             throw new ArgumentError();
         }
         $this->subtree[$index]->insert($obj);
     }
 }
开发者ID:EdenChan,项目名称:Instances,代码行数:24,代码来源:BTree.php


示例19: getEmailResponse

 /**
  * @param $request
  * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse
  */
 public function getEmailResponse($request)
 {
     if ($this->data === PasswordBroker::INVALID_USER) {
         if ($request->ajax()) {
             return response()->json(['message' => $this->userNotFoundMessage], 404);
         } else {
             flash()->error($this->userNotFoundMessage);
             return redirect()->back()->with('email', $request->get('email'));
         }
     }
     if ($this->data === PasswordBroker::RESET_LINK_SENT) {
         if ($request->ajax()) {
             return response()->json(['message' => "Password reset instructions successfully sent to {$request->get('email')}", 'target' => eq($request->segment(1), 'backend') ? route('backend.login') : route('login')]);
         } else {
             flash("Password reset instructions successfully sent to {$request->get('email')}");
             return eq($request->segment(1), 'backend') ? redirect()->route('backend.login') : redirect()->route('login');
         }
     }
 }
开发者ID:muhamadsyahril,项目名称:ecommerce-1,代码行数:23,代码来源:ResetPasswordsRedirector.php


示例20: upload

 /**
  * @role update
  */
 public function upload()
 {
     $result = parent::upload();
     $request = $this->getRequest();
     if ($request->get('setAsMainImage')) {
         $data = json_decode($result->get('result'));
         $imageID = $data->ID;
         $filter = select(eq(f('ProductImage.productID'), $request->get('ownerId')));
         $filter->setOrder(f('ProductImage.position'));
         $r = ActiveRecordModel::getRecordSetArray('ProductImage', $filter, true);
         $order = array($imageID);
         foreach ($r as $item) {
             if ($imageID != $item['ID']) {
                 $order[] = $item['ID'];
             }
         }
         parent::saveOrder($order);
     }
     return $result;
 }
开发者ID:saiber,项目名称:www,代码行数:23,代码来源:ProductQuickImageController.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP eq_array函数代码示例发布时间:2022-05-15
下一篇:
PHP eprintln函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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