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


PHP Where::equalTo方法代码示例

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


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

示例1: getTranslationListForSearch

 public function getTranslationListForSearch($filterParams = array())
 {
     $columns = array('id' => 'id', 'type' => 'entity_type', 'content' => 'en', 'entity_name' => new Expression("\n                CASE\n                    WHEN (apartel.id IS NOT NULL) THEN apartel_group.name\n                    WHEN (building.id IS NOT NULL) THEN building.name\n                    WHEN (apartment.id IS NOT NULL) THEN apartment.name\n                    WHEN (office.id IS NOT NULL) THEN office.name\n                    WHEN (parking.id IS NOT NULL) THEN parking.name\n                    WHEN (building_section.id IS NOT NULL) THEN CONCAT(building_for_section.name, ' ', building_section.name)\n                END\n            "));
     $sortColumns = ['id'];
     $result = $this->fetchAll(function (Select $select) use($columns, $sortColumns, $filterParams) {
         $select->columns($columns);
         $select->join(['apartment' => DbTables::TBL_APARTMENTS], new Expression($this->getTable() . '.entity_id = apartment.id AND ' . $this->getTable() . '.entity_type IN (' . implode(', ', Translation::$APARTMENT_TEXTLINE_TYPES) . ')'), [], $select::JOIN_LEFT)->join(['apartel' => DbTables::TBL_APARTELS], new Expression($this->getTable() . '.entity_id = apartel.id AND ' . $this->getTable() . '.entity_type IN (' . implode(', ', Translation::$APARTEL_TEXTLINE_TYPES) . ')'), [], $select::JOIN_LEFT)->join(['apartel_group' => DbTables::TBL_APARTMENT_GROUPS], 'apartel.apartment_group_id = apartel_group.id', [], $select::JOIN_LEFT)->join(['building' => DbTables::TBL_APARTMENT_GROUPS], new Expression($this->getTable() . '.entity_id = building.id AND ' . $this->getTable() . '.entity_type IN (' . implode(', ', Translation::$BUILDING_TEXTLINE_TYPES) . ')'), [], $select::JOIN_LEFT)->join(['building_section' => DbTables::TBL_BUILDING_SECTIONS], new Expression($this->getTable() . '.entity_id = building_section.id AND ' . $this->getTable() . '.entity_type =' . Translation::PRODUCT_TEXTLINE_TYPE_BUILDING_SECTION_APARTMENT_ENTRY), [], $select::JOIN_LEFT)->join(['building_for_section' => DbTables::TBL_APARTMENT_GROUPS], 'building_section.building_id = building_for_section.id', [], $select::JOIN_LEFT)->join(['office' => DbTables::TBL_OFFICES], new Expression($this->getTable() . '.entity_id = office.id AND ' . $this->getTable() . '.entity_type IN (' . implode(', ', Translation::$OFFICE_TEXTLINE_TYPES) . ')'), [], $select::JOIN_LEFT)->join(['parking' => DbTables::TBL_PARKING_LOTS], new Expression($this->getTable() . '.entity_id = parking.id AND ' . $this->getTable() . '.entity_type IN (' . implode(', ', Translation::$PARKING_TEXTLINE_TYPES) . ')'), [], $select::JOIN_LEFT);
         $where = new Where();
         $textSearch = '%' . strip_tags(trim($filterParams["srch_txt"])) . '%';
         if ((int) $filterParams["id_translation"] > 0) {
             $where->equalTo($this->getTable() . '.entity_id', $filterParams["id_translation"]);
         } else {
             if ($filterParams["srch_txt"] != '') {
                 $where->NEST->like('apartment.name', $textSearch)->or->NEST->like('apartel_group.name', $textSearch)->or->NEST->like('building.name', $textSearch)->or->NEST->like('office.name', $textSearch)->or->like('parking.name', $textSearch)->or->like($this->getTable() . '.en_html_clean', $textSearch)->UNNEST;
             }
         }
         if ((int) $filterParams['product_type']) {
             $where->equalTo($this->getTable() . '.type', (int) $filterParams['product_type']);
         }
         $select->where($where);
         $select->group($this->getTable() . '.id');
         $select->quantifier(new Expression('SQL_CALC_FOUND_ROWS'));
     });
     $statement = $this->adapter->query('SELECT FOUND_ROWS() as total');
     $resultCount = $statement->execute();
     $row = $resultCount->current();
     $total = $row['total'];
     return ['result' => $result, 'total' => $total];
 }
开发者ID:arbi,项目名称:MyCode,代码行数:29,代码来源:Product.php

示例2: removeSerie

 public function removeSerie($userId, $serieId)
 {
     $where = new Where();
     $where->equalTo('user_id', $userId);
     $where->equalTo('sid', $serieId);
     return parent::delete($where, $this->tableName);
 }
开发者ID:shitikovkirill,项目名称:zend-shop.com,代码行数:7,代码来源:RememberMe.php

示例3: getChatMesByGetter

 public function getChatMesByGetter($getter)
 {
     $where = new Where();
     $where->equalTo('getter', $getter);
     $where->equalTo('isread', 1);
     $rowset = $this->tableGateway->select($where);
     return iterator_to_array($rowset);
 }
开发者ID:artpoplsh,项目名称:learningZf2,代码行数:8,代码来源:ChatMesTable.php

示例4: getByTicket

 /**
  * @param int $moduleId
  * @param int $identityId
  * @param int $actionId
  *
  * @return \ArrayObject|\ArrayObject[]
  */
 public function getByTicket($moduleId, $identityId, $actionId = null)
 {
     return $this->fetchAll(function (Select $select) use($moduleId, $identityId, $actionId) {
         $where = new Where();
         $where->equalTo($this->getTable() . '.module_id', $moduleId)->equalTo($this->getTable() . '.identity_id', $identityId);
         if (!is_null($actionId)) {
             $where->equalTo($this->getTable() . '.action_id', $actionId);
         }
         $select->join(['users' => DbTables::TBL_BACKOFFICE_USERS], $this->getTable() . '.user_id = users.id', ['user_name' => new Expression('CONCAT(firstname, " ", lastname)'), 'is_system' => 'system'], Select::JOIN_LEFT)->where($where)->order([$this->getTable() . '.timestamp DESC', $this->getTable() . '.id DESC']);
     });
 }
开发者ID:arbi,项目名称:MyCode,代码行数:18,代码来源:ActionLogs.php

示例5: getPolaFormularza

 public function getPolaFormularza($iIdForm)
 {
     $iIdForm = intval($iIdForm);
     $where = new Where();
     $where->equalTo('id_formularza', $iIdForm);
     $where->equalTo('status', 1);
     $rowset = $this->select(function (Select $select) use($where) {
         $select->where($where);
         $select->order('pozycjonowanie ASC');
     });
     return $rowset->toArray();
 }
开发者ID:mariuszfilip,项目名称:umowatorium,代码行数:12,代码来源:FormElements.php

示例6: findCourses

 public function findCourses($free, $disability, $child_care, $lat, $lng)
 {
     $sql = new Sql($this->tableGateway->getAdapter());
     $select = $sql->select();
     $select->from(array("co" => "course"))->join(array("cc" => "course_centre"), "co.id = cc.course_id")->join(array("ce" => "centre"), "ce.id = cc.centre_id", array("centre_id" => "id", "centreName" => "name", "location" => new Expression("AsWKT(location)"), "post_code", "address", "buses", "tube", "accebility", "accebility_condition", "other_information"));
     //especificar las columnas que queremos en el resultados de las consultas.
     $select->columns(array("id", "courseName" => "name", "class_type", "levels", "who_join", "how_join", "when_join", "how_long", "cost_free", "cost_condition", "times", "documentation_required", "contact_phone", "contact_email", "contact_person", "child_care", "child_condition", "organization_id", "other_information"));
     $where = new Where();
     //TODO terminar de poner prefijos a las tablas
     if (isset($free)) {
         if ($free == 'Yes') {
             $where->in("co.cost_free", array("y", "c"));
         } else {
             if ($free == 'No') {
                 $where->equalTo("co.cost_free", "n");
             }
         }
     }
     if (isset($disability)) {
         if ($disability == 'Yes') {
             $where->in("ce.accebility", array("y", "c"));
         } else {
             if ($disability == 'No') {
                 $where->equalTo("ce.accebility", "n");
             }
         }
     }
     if (isset($child_care)) {
         if ($child_care == 'Yes') {
             $where->in("co.child_care", array("y", "c"));
         } else {
             if ($child_care == 'No') {
                 $where->equalTo("co.child_care", "n");
             }
         }
     }
     //hacemos busquedas en 3km a la redonda, se puede convertir en un parametro
     $R = 6371;
     //radio de la tierra en km
     if (isset($lat) && isset($lng)) {
         $maxLat = $lat + rad2deg(1.5 / $R);
         $minLat = $lat - rad2deg(1.5 / $R);
         $maxLng = $lng + rad2deg(1.5 / $R / cos(deg2rad($lat)));
         $minLng = $lng - rad2deg(1.5 / $R / cos(deg2rad($lat)));
         $where->between(new Expression("X(ce.location)"), $minLat, $maxLat);
         $where->between(new Expression("y(ce.location)"), $minLng, $maxLng);
     }
     //TODO terminar con el resto de los filtros de busqueda
     $select->where($where);
     $statement = $sql->prepareStatementForSqlObject($select);
     $rowset = $statement->execute();
     return $rowset;
 }
开发者ID:qperez5,项目名称:esol_exchange,代码行数:53,代码来源:CourseTable.php

示例7: getTranslationListForSearch

 public function getTranslationListForSearch($filterParams = [])
 {
     $where = new Where();
     $hasPageQuery = false;
     if ((int) $filterParams["id_translation"] > 0) {
         $where->equalTo($this->getTable() . '.id', $filterParams["id_translation"]);
     } else {
         if ($filterParams["srch_txt"] != '') {
             $where->like($this->getTable() . '.en_html_clean', '%' . strip_tags(trim($filterParams["srch_txt"])) . '%');
         }
         if ($filterParams['category'] == 1 && isset($filterParams['un_type'][0])) {
             $pages = explode(',', $filterParams['un_type'][0]);
             $where->in('pr.page_id', $pages);
         }
         if ($filterParams["description"] != '') {
             $where->like($this->getTable() . '.description', '%' . strip_tags(trim($filterParams["description"])) . '%');
         }
     }
     $columns = array('id' => 'id', 'content' => 'en', 'description' => 'description', 'page_name' => new Expression("GROUP_CONCAT(p.name SEPARATOR ', ')"));
     $sortColumns = ['id', 'en'];
     $result = $this->fetchAll(function (Select $select) use($columns, $sortColumns, $where) {
         $select->columns($columns);
         $select->join(['pr' => DbTables::TBL_UN_TEXTLINE_PAGE_REL], $this->getTable() . '.id = pr.textline_id', []);
         $select->join(['p' => DbTables::TBL_PAGES], 'p.id = pr.page_id', []);
         if ($where !== null) {
             $select->where($where);
         }
         $select->group($this->getTable() . '.id');
         $select->quantifier(new Expression('SQL_CALC_FOUND_ROWS'));
     });
     $statement = $this->adapter->query('SELECT FOUND_ROWS() as count');
     $result2 = $statement->execute();
     $row = $result2->current();
     return ['result' => $result, 'count' => $row['count']];
 }
开发者ID:arbi,项目名称:MyCode,代码行数:35,代码来源:Universal.php

示例8: fillInventory

 public function fillInventory($userId, $startDate, $officeId)
 {
     /** @var \DDD\Dao\User\Schedule\Inventory $inventoryDao */
     $inventoryDao = $this->getServiceLocator()->get('dao_user_schedule_inventory');
     $deleteWhere = new Where();
     $deleteWhere->equalTo('user_id', $userId)->greaterThanOrEqualTo('date', date('Y-m-d', strtotime($startDate)))->notEqualTo('is_changed', 1);
     $inventoryDao->delete($deleteWhere);
     $scheduleData = $this->getUserSchedule($userId);
     $scheduleArr = [];
     if ($scheduleData) {
         foreach ($scheduleData as $daySchedule) {
             $scheduleArr[$daySchedule->getDay()] = $daySchedule;
         }
     }
     // Fill up to 3 months ahead
     $endDate = date('Y-m-d', strtotime('+92 days'));
     $dateIterator = date('Y-m-d', strtotime($startDate));
     $insertArray = [];
     while ($dateIterator < $endDate) {
         /** @var \DDD\Domain\User\Schedule\Schedule $daySchedule */
         if (count($scheduleArr)) {
             for ($scheduleIndex = 1; $scheduleIndex <= count($scheduleArr); $scheduleIndex++) {
                 $daySchedule = $scheduleArr[$scheduleIndex];
                 array_push($insertArray, ['user_id' => $userId, 'office_id' => $officeId, 'date' => $dateIterator, 'availability' => $daySchedule->isActive(), 'time_from1' => $daySchedule->isActive() ? $daySchedule->getTimeFrom1() : '', 'time_to1' => $daySchedule->isActive() ? $daySchedule->getTimeTo1() : '', 'time_from2' => $daySchedule->isActive() ? $daySchedule->getTimeFrom2() : '', 'time_to2' => $daySchedule->isActive() ? $daySchedule->getTimeTo2() : '']);
                 $dateIterator = date('Y-m-d', strtotime($dateIterator . '+1 days'));
             }
             // The case when user has no schedule scheme. Fill the inventory with 0 availability
         } else {
             array_push($insertArray, ['user_id' => $userId, 'office_id' => $officeId, 'date' => $dateIterator, 'availability' => 0, 'time_from1' => '', 'time_to1' => '', 'time_from2' => '', 'time_to2' => '']);
             $dateIterator = date('Y-m-d', strtotime($dateIterator . '+1 days'));
         }
     }
     $inventoryDao->multiInsert($insertArray, true);
 }
开发者ID:arbi,项目名称:MyCode,代码行数:34,代码来源:Schedule.php

示例9: isUnitUniqueInLot

 public function isUnitUniqueInLot($params)
 {
     $prototype = $this->resultSetPrototype->getArrayObjectPrototype();
     $this->resultSetPrototype->setArrayObjectPrototype(new \ArrayObject());
     $result = $this->fetchOne(function (Select $select) use($params) {
         $where = new Where();
         if ($params['id']) {
             $where->notEqualTo($this->getTable() . '.id', $params['id']);
         }
         $where->equalTo($this->getTable() . '.unit', $params['unit']);
         $where->equalTo($this->getTable() . '.lot_id', $params['lot_id']);
         $select->columns(['id'])->where($where);
     });
     $this->resultSetPrototype->setArrayObjectPrototype($prototype);
     return $result;
 }
开发者ID:arbi,项目名称:MyCode,代码行数:16,代码来源:Spot.php

示例10: getCategoriesByTypeList

 /**
  * @param array $typeList
  * @param bool|true $onlyActive
  * @return \DDD\Domain\Warehouse\Category\Category[]
  */
 public function getCategoriesByTypeList($typeList = [], $onlyActive = true, $selectedId = 0, $returnArray = false)
 {
     $entity = $this->getEntity();
     $this->setEntity(new \DDD\Domain\Warehouse\Category\Category());
     if ($returnArray) {
         $this->setEntity(new \ArrayObject());
     }
     $result = $this->fetchAll(function (Select $select) use($typeList, $onlyActive, $selectedId) {
         $select->columns(['id', 'name', 'type' => 'type_id', 'inactive']);
         $nestedWhere = new Where();
         $where = new Where();
         if (!empty($typeList)) {
             $nestedWhere->in('type_id', $typeList);
         }
         if ($onlyActive) {
             $nestedWhere->equalTo('inactive', AssetsCategoryService::CATEGORY_STATUS_ACTIVE);
         }
         if ($selectedId) {
             $where->equalTo('id', $selectedId)->orPredicate($nestedWhere);
         } else {
             $where = $nestedWhere;
         }
         $select->where($where)->order('type_id');
     });
     $this->setEntity($entity);
     return $result;
 }
开发者ID:arbi,项目名称:MyCode,代码行数:32,代码来源:Category.php

示例11: getBlackList

 public function getBlackList($data)
 {
     $result = $this->fetchAll(function (Select $select) use($data) {
         $select->join(['reservation' => DbTables::TBL_BOOKINGS], $this->getTable() . '.reservation_id = reservation.id', ['res_number'], $select::JOIN_LEFT);
         $where = new Where();
         $where->equalTo('hash', '');
         if (!empty($data['email'])) {
             $where->or->equalTo('hash', $data['email']);
         }
         if (!empty($data['fullNamePhone'])) {
             $where->or->equalTo('hash', $data['fullNamePhone']);
         }
         if (!empty($data['fullNameAddress'])) {
             $where->or->equalTo('hash', $data['fullNameAddress']);
         }
         if (!empty($data['fullName'])) {
             $where->or->equalTo('hash', $data['fullName']);
         }
         if (!empty($data['phone'])) {
             $where->or->equalTo('hash', $data['phone']);
         }
         $select->where($where);
     });
     return $result;
 }
开发者ID:arbi,项目名称:MyCode,代码行数:25,代码来源:BlackList.php

示例12: userLogin

 public function userLogin($email, $pass)
 {
     $sql = new Sql($this->getAdaptor());
     $select = $sql->select('user');
     $criteria = new Where();
     $criteria->equalTo('password', md5($pass));
     $criteria->equalTo('email', $email);
     $criteria->OR->equalTo('username', $email);
     $select->where($criteria);
     $statment = $sql->prepareStatementForSqlObject($select);
     $result = $statment->execute();
     if ($result instanceof ResultInterface && $result->isQueryResult() && $result->getAffectedRows()) {
         return array('isValidUser' => true, 'user' => $result->current());
     }
     throw new \InvalidArgumentException("Member with given email :{$email} not found.");
 }
开发者ID:projectsmahendra,项目名称:blogger,代码行数:16,代码来源:UserService.php

示例13: fetchUserTimeline

 public function fetchUserTimeline($user)
 {
     $select = $this->getSql()->select();
     $where = new Where();
     $where->equalTo('username', $user);
     $select->where($where)->order('timestamp DESC');
     return new Paginator(new DbSelect($select, $this->adapter, $this->resultSetPrototype));
 }
开发者ID:vrkansagara,项目名称:PhlyPeep,代码行数:8,代码来源:PeepTable.php

示例14: getTransferByTransaction

 /**
  * @param $transactionId
  * @return array|\ArrayObject|null
  */
 public function getTransferByTransaction($transactionId)
 {
     return $this->fetchOne(function (Select $select) use($transactionId) {
         $where = new Where();
         $where->equalTo('money_transaction_id_1', $transactionId)->or->equalTo('money_transaction_id_2', $transactionId);
         $select->where($where)->columns(['id', 'money_transaction_id_1', 'money_transaction_id_2', 'amount_from', 'amount_to'])->join(['ta1' => DbTables::TBL_TRANSACTION_ACCOUNTS], new Expression($this->getTable() . '.account_id_from = ta1.id AND ta1.type = ' . Account::TYPE_MONEY_ACCOUNT), [], Select::JOIN_LEFT)->join(['ma1' => DbTables::TBL_MONEY_ACCOUNT], 'ta1.holder_id = ma1.id', ['money_account_id_from' => 'id', 'account_currency_from' => 'currency_id'], Select::JOIN_LEFT)->join(['ta2' => DbTables::TBL_TRANSACTION_ACCOUNTS], new Expression($this->getTable() . '.account_id_to = ta2.id AND ta2.type = ' . Account::TYPE_MONEY_ACCOUNT), [], Select::JOIN_LEFT)->join(['ma2' => DbTables::TBL_MONEY_ACCOUNT], 'ta2.holder_id = ma2.id', ['money_account_id_to' => 'id', 'account_currency_to' => 'currency_id'], Select::JOIN_LEFT);
     });
 }
开发者ID:arbi,项目名称:MyCode,代码行数:12,代码来源:TransferTransactions.php

示例15: getDocumento

 /**
  * 
  * @param string $search
  * @return mixed
  */
 public function getDocumento($search = '')
 {
     $select = $this->sql->select()->from(array('t1' => 'bdc_documento'))->join(array('t2' => 'bdc_tipo_documento'), 't1.tipd_id=t2.tipd_id', array('*'));
     $where = new Where();
     $where->equalTo('doc_numero', $search);
     $select->where($where);
     return $this->fetchRow($select);
 }
开发者ID:biialaborg,项目名称:budocu.com,代码行数:13,代码来源:BdcDocumentoRepository.php


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