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


PHP Script::create方法代码示例

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


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

示例1: setScript

 /**
  * Set script
  *
  * @param  string|\Elastica\Script          $script
  * @return \Elastica\Query\CustomScore
  */
 public function setScript($script)
 {
     $script = Script::create($script);
     foreach ($script->toArray() as $param => $value) {
         $this->setParam($param, $value);
     }
     return $this;
 }
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:14,代码来源:CustomScore.php

示例2: setScript

 /**
  * Sets script object
  *
  * @param  \Elastica\Script|string|array $script
  * @return \Elastica\Filter\Script
  */
 public function setScript($script)
 {
     $script = Elastica\Script::create($script);
     return $this->setParams($script->toArray());
 }
开发者ID:raadhuis,项目名称:modx-basic,代码行数:11,代码来源:Script.php

示例3: testCreateInvalid

 /**
  * @group unit
  * @dataProvider dataProviderCreateInvalid
  * @expectedException \Elastica\Exception\InvalidException
  */
 public function testCreateInvalid($data)
 {
     Script::create($data);
 }
开发者ID:MediaWiki-stable,项目名称:1.26.1,代码行数:9,代码来源:ScriptTest.php

示例4: setScript

 /**
  * @param \Elastica\Script|array|string $data
  * @return \Elastica\Document
  */
 public function setScript($data)
 {
     $script = Script::create($data);
     $this->_script = $script;
     return $this;
 }
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:10,代码来源:Document.php

示例5: setScript

 /**
  * Sets script object.
  *
  * @param \Elastica\Script|string|array $script
  *
  * @return $this
  */
 public function setScript($script)
 {
     return $this->setParam('script', Elastica\Script::create($script));
 }
开发者ID:zhangxiaoliu,项目名称:Elastica,代码行数:11,代码来源:Script.php

示例6: addFilterScript

 /**
  * Add a filter with a script to calculate the score
  * Only script part of script object is used
  *
  * @param  \Elastica\Filter\AbstractFilter         $filter Filter object
  * @param  \Elastica\Script|string|array           $script Script for calculating the score
  * @return \Elastica\Query\CustomFiltersScore Current object
  */
 public function addFilterScript(AbstractFilter $filter, $script)
 {
     $script = Script::create($script);
     $filterParam = array('filter' => $filter->toArray(), 'script' => $script->getScript());
     return $this->addParam('filters', $filterParam);
 }
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:14,代码来源:CustomFiltersScore.php

示例7: setScript

 /**
  * Sets the script for the term.
  *
  * @param string $script The script for the term.
  *
  * @return $this
  */
 public function setScript($script)
 {
     $this->setParam('script', Script::create($script));
     return $this;
 }
开发者ID:nadeem-khan,项目名称:Elastica,代码行数:12,代码来源:Terms.php


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