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

PHP AbstractQuery类代码示例

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

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



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

示例1: createInstanceByQueryString

 /**
  * Creates an instance of Query based on given query string.
  *
  * @param  string $query SPARQL query string to use for class instantiation.
  * @return Query Instance of Query.
  */
 public function createInstanceByQueryString($query)
 {
     switch (AbstractQuery::getQueryType($query)) {
         case 'askQuery':
             return new AskQueryImpl($query);
         case 'describeQuery':
             return new DescribeQueryImpl($query);
         case 'graphQuery':
             return new GraphQueryImpl($query);
         case 'selectQuery':
             return new SelectQueryImpl($query);
         case 'updateQuery':
             return new UpdateQueryImpl($query);
         default:
             throw new \Exception('Unknown query type: ' . $query);
     }
 }
开发者ID:guitarmarx,项目名称:Saft,代码行数:23,代码来源:QueryFactoryImpl.php


示例2: setNegativeQuery

 /**
  * Set the negative query for this Boosting Query
  * @param AbstractQuery $query
  * @return \Elastica\Query\Boosting
  */
 public function setNegativeQuery(AbstractQuery $query)
 {
     return $this->setParam('negative', $query->toArray());
 }
开发者ID:viz,项目名称:wordpress-fantastic-elasticsearch,代码行数:9,代码来源:Boosting.php


示例3: setQuery

 /**
  * Sets nested query.
  *
  * @param \Elastica\Query\AbstractQuery $query
  *
  * @return $this
  */
 public function setQuery(AbstractQuery $query)
 {
     return $this->setParam('query', $query->toArray());
 }
开发者ID:MediaWiki-stable,项目名称:1.26.1,代码行数:11,代码来源:Nested.php


示例4: toArray

 /**
  * Converts query to array
  *
  * @return array Query array
  * @see \Elastica\Query\AbstractQuery::toArray()
  */
 public function toArray()
 {
     $this->setParam($this->_field, array('query' => $this->_queryString));
     return parent::toArray();
 }
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:11,代码来源:Field.php


示例5:

 function __construct(Database $db, $into)
 {
     parent::__construct($db);
     $this->_table = str_replace($this->getGraveAccent(), '', $into);
     // TODO null check on $into
     return $this;
 }
开发者ID:slaymaster3000,项目名称:airbase-php,代码行数:7,代码来源:InsertQuery.php


示例6: tableRaw

 /**
  * Specify the tabe to insert in to
  *
  * @param string $table
  * @param array $params
  * @return $this
  * @throws \RuntimeException
  */
 public function tableRaw($table, array $params = array())
 {
     if (count($this->tables) != 0) {
         throw new \RuntimeException("You may not set multiple tables");
     }
     return parent::tableRaw($table, $params);
 }
开发者ID:searbe,项目名称:brite-sql,代码行数:15,代码来源:Insert.php


示例7: toArray

 /**
  * {@inheritdoc}
  */
 public function toArray()
 {
     $array = parent::toArray();
     if (isset($array['script'])) {
         $array['script'] = $array['script']['script'];
     }
     return $array;
 }
开发者ID:makeandship,项目名称:wordpress-fantastic-elasticsearch,代码行数:11,代码来源:Script.php


示例8: foreach

 function __construct(Database $db, array $fields = null)
 {
     parent::__construct($db);
     foreach ($fields as $field) {
         $this->_fields[] = str_replace($this->getGraveAccent(), '', $field);
         // add the field to the array of fields, remove any `s for the field name
     }
     return $this;
 }
开发者ID:slaymaster3000,项目名称:airbase-php,代码行数:9,代码来源:SelectQuery.php


示例9: toArray

 /**
  * {@inheritdoc}
  */
 public function toArray()
 {
     $array = parent::toArray();
     $baseName = $this->_getBaseName();
     if (isset($array[$baseName]['query'])) {
         $array[$baseName]['query'] = $array[$baseName]['query']['query'];
     }
     return $array;
 }
开发者ID:ruflin,项目名称:elastica,代码行数:12,代码来源:HasChild.php


示例10: __construct

 /**
  * @param string|Table|null $table
  * @param string|array|Column[] $cols
  */
 public function __construct($table = null, $cols = array(Column::ALL))
 {
     parent::__construct();
     if ($table) {
         $this->setTable($table);
     }
     if (count($cols)) {
         $this->setColumns($cols);
     }
 }
开发者ID:romainbessugesmeusy,项目名称:php-sql-query,代码行数:14,代码来源:Select.php


示例11: getBindValues

 /**
  *
  * Gets the values to bind to placeholders, including any 'where' values
  * (needed for INSERT and UPDATE).
  *
  * @return array
  *
  */
 public function getBindValues()
 {
     $bind_values = parent::getBindValues();
     $i = 1;
     foreach ($this->bind_where as $val) {
         $bind_values[$i] = $val;
         $i++;
     }
     return $bind_values;
 }
开发者ID:brian978,项目名称:Acamar-SkeletonApplication,代码行数:18,代码来源:AbstractDmlQuery.php


示例12: getQuery

 /**
  * @return string
  *
  * @throws \RuntimeException if documentName is null
  */
 public function getQuery()
 {
     $documentName = $this->documentName;
     if ($documentName == null) {
         throw new \RuntimeException('documentName should not be null');
     }
     $query = sprintf('id:%s_*', $documentName);
     $this->setQuery($query);
     return parent::getQuery();
 }
开发者ID:zquintana,项目名称:SolrBundle,代码行数:15,代码来源:FindByDocumentNameQuery.php


示例13: getQuery

 /**
  * @return string
  *
  * @throws \RuntimeException if documentName is null
  */
 public function getQuery()
 {
     $documentNameField = $this->document->document_name_s;
     if ($documentNameField == null) {
         throw new \RuntimeException('documentName should not be null');
     }
     $query = sprintf('document_name_s:%s', $documentNameField);
     $this->setQuery($query);
     return parent::getQuery();
 }
开发者ID:royopa,项目名称:SolrBundle,代码行数:15,代码来源:FindByDocumentNameQuery.php


示例14: getQuery

 /**
  * @return string
  *
  * @throws \RuntimeException when id or document_name is null
  */
 public function getQuery()
 {
     $idField = $this->documentKey;
     if ($idField == null) {
         throw new \RuntimeException('id should not be null');
     }
     $query = sprintf('id:%s', $idField);
     $this->setQuery($query);
     return parent::getQuery();
 }
开发者ID:zquintana,项目名称:SolrBundle,代码行数:15,代码来源:FindByIdentifierQuery.php


示例15: toArray

 /**
  * @return array
  */
 public function toArray()
 {
     $array = parent::toArray();
     // if there are no params, it's ok, but ES will throw exception if json
     // will be like {"top_hits":[]} instead of {"top_hits":{}}
     if (empty($array['inner_hits'])) {
         $array['inner_hits'] = new \stdClass();
     }
     return $array['inner_hits'];
 }
开发者ID:ruflin,项目名称:elastica,代码行数:13,代码来源:InnerHits.php


示例16: __construct

 /**
  * Constructor.
  *
  * @param  string optional $query SPARQL query string to initialize this instance.
  */
 public function __construct($query = '')
 {
     parent::__construct($query);
     if (null === $this->query) {
         return;
     }
     $parts = array('select' => array(), 'from' => array(), 'from_named' => array(), 'where' => array(), 'order' => array(), 'limit' => array(), 'offset' => array());
     // regex for variables
     $var = '[?$]{1}[\\w\\d]+';
     $tokens = array('select' => '/(' . '((SELECT(\\s)+)(DISTINCT(\\s)+)' . '?(COUNT(\\s)*(\\(.*?\\)(\\s)))?)(\\?\\w+\\s+|\\*)*' . '(\\(LANG\\(\\?[a-zA-Z0-9\\_]+\\)\\)* as{1}\\s\\?[a-zA-Z0-9\\_]+)*' . ')/si', 'from' => '/FROM\\s+<(.+?)>/i', 'from_named' => '/FROM\\s+NAMED\\s+<(.+?)>/i', 'where' => '/(WHERE\\s+)?\\{.*\\}/si', 'order' => '/ORDER\\s+BY((\\s+' . $var . '|\\s+(ASC|DESC)\\s*\\(\\s*' . $var . '\\s*\\))+)/i', 'limit' => '/LIMIT\\s+(\\d+)/i', 'offset' => '/OFFSET\\s+(\\d+)/i');
     foreach ($tokens as $key => $pattern) {
         preg_match_all($pattern, $query, $parts[$key]);
     }
     if (isset($parts['select'][0][0])) {
         $this->queryParts['select'] = trim($parts['select'][0][0]);
     }
     /**
      * FROM
      */
     if (isset($parts['from'][1][0])) {
         $this->queryParts['graphs'] = $parts['from'][1];
     }
     /**
      * FROM NAMED
      */
     if (isset($parts['from_named'][1][0])) {
         $this->queryParts['named_graphs'] = $parts['from_named'][1];
     }
     /**
      * WHERE
      */
     if (isset($parts['where'][0][0])) {
         $this->queryParts['where'] = $parts['where'][0][0];
     }
     /**
      * ORDER BY
      */
     if (isset($parts['order'][1][0])) {
         $this->queryParts['order'] = trim($parts['order'][1][0]);
     }
     /**
      * LIMIT
      */
     if (isset($parts['limit'][1][0])) {
         $this->queryParts['limit'] = $parts['limit'][1][0];
     }
     /**
      * OFFSET
      */
     if (isset($parts['offset'][1][0])) {
         $this->queryParts['offset'] = $parts['offset'][1][0];
     }
 }
开发者ID:guitarmarx,项目名称:Saft,代码行数:58,代码来源:SelectQueryImpl.php


示例17: toArray

 public function toArray()
 {
     $array = parent::toArray();
     // If _id is provided, perform MLT on an existing document from the index
     // If _source is provided, perform MLT on a document provided as an input
     if (!empty($array['more_like_this']['like']['_id'])) {
         $doc = $array['more_like_this']['like'];
         $doc = array_intersect_key($doc, array('_index' => 1, '_type' => 1, '_id' => 1));
         $array['more_like_this']['like'] = $doc;
     } elseif (!empty($array['more_like_this']['like']['_source'])) {
         $doc = $array['more_like_this']['like'];
         $doc['doc'] = $array['more_like_this']['like']['_source'];
         unset($doc['_id']);
         unset($doc['_source']);
         $array['more_like_this']['like'] = $doc;
     }
     return $array;
 }
开发者ID:makeandship,项目名称:wordpress-fantastic-elasticsearch,代码行数:18,代码来源:MoreLikeThis.php


示例18:

 function __construct(Database $db, $table)
 {
     parent::__construct($db);
     $this->_table = $table;
     return $this;
 }
开发者ID:slaymaster3000,项目名称:airbase-php,代码行数:6,代码来源:UpdateQuery.php


示例19: _getMap

 public function _getMap()
 {
     $parentMap = parent::_getMap();
     return array_merge($parentMap, array('Id' => 'id', 'IdContent' => 'id_content', 'Pseudo' => 'pseudo', 'IdUser' => 'id_user', 'IdGroupe' => 'id_groupe', 'Langue' => 'langue', 'Titre' => 'titre', 'Description' => 'description', 'ArticleTinymce' => 'article_tinymce', 'Uri' => 'uri', 'UriModule' => 'uri_module', 'MetaTitre' => 'meta_titre', 'MetaDescription' => 'meta_description', 'MetaKeys' => 'meta_keys', 'DateCreation' => 'date_creation'));
 }
开发者ID:neoartdoo,项目名称:CMS,代码行数:5,代码来源:DgPageVersionQuery.php


示例20: addField

 /**
  * @param string $field
  *
  * @return SolrQuery
  */
 public function addField($field)
 {
     $entityFieldNames = array_flip($this->mappedFields);
     if (array_key_exists($field, $entityFieldNames)) {
         parent::addField($entityFieldNames[$field]);
     }
     return $this;
 }
开发者ID:wizbit,项目名称:SolrBundle,代码行数:13,代码来源:SolrQuery.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP AbstractRequestType类代码示例发布时间:2022-05-23
下一篇:
PHP AbstractPlatform类代码示例发布时间: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