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


PHP Document::getType方法代码示例

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


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

示例1: testSetIndex

 /**
  * @group unit
  */
 public function testSetIndex()
 {
     $document = new Document();
     $document->setIndex('index2');
     $document->setType('type2');
     $this->assertEquals('index2', $document->getIndex());
     $this->assertEquals('type2', $document->getType());
     $index = new Index($this->_getClient(), 'index');
     $document->setIndex($index);
     $this->assertEquals('index', $document->getIndex());
     $this->assertEquals('type2', $document->getType());
 }
开发者ID:MediaWiki-stable,项目名称:1.26.1,代码行数:15,代码来源:DocumentTest.php

示例2: __construct

 /**
  * DocumentFactory constructor.
  *
  * @param Document $prototype
  */
 public function __construct(Document $prototype)
 {
     if ($prototype->getIndex() === '' || $prototype->getType() === '') {
         throw new \InvalidArgumentException('prototype not properly inited');
     }
     $this->docPrototype = $prototype;
     $fieldValuePairs = get_object_vars(new User());
     array_walk($fieldValuePairs, function ($value, $field) {
         $this->fieldList[$field] = gettype($value);
     });
 }
开发者ID:jiangyu7408,项目名称:notification,代码行数:16,代码来源:DocumentFactory.php


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