diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2015-10-18 09:31:31 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2015-10-18 09:31:31 +0200 |
commit | 80f7dc77d430774192b929d780f96260066df2ee (patch) | |
tree | 102eaae7fc9ec567f2af76e96da3de2d1e83afcf /vendor/ruflin/elastica/lib/Elastica/Bulk/Action/UpdateDocument.php | |
parent | cccd7bb4d819334c07e0dadaf16cbfdef31880e1 (diff) |
Update to MediaWiki 1.25.3
Diffstat (limited to 'vendor/ruflin/elastica/lib/Elastica/Bulk/Action/UpdateDocument.php')
-rw-r--r-- | vendor/ruflin/elastica/lib/Elastica/Bulk/Action/UpdateDocument.php | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/vendor/ruflin/elastica/lib/Elastica/Bulk/Action/UpdateDocument.php b/vendor/ruflin/elastica/lib/Elastica/Bulk/Action/UpdateDocument.php deleted file mode 100644 index 4c1dbaa4..00000000 --- a/vendor/ruflin/elastica/lib/Elastica/Bulk/Action/UpdateDocument.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php - -namespace Elastica\Bulk\Action; - -use Elastica\Document; -use Elastica\Script; - -/** - * @package Elastica\Bulk\Action - * @link http://www.elasticsearch.org/guide/reference/api/bulk/ - */ -class UpdateDocument extends IndexDocument -{ - /** - * @var string - */ - protected $_opType = self::OP_TYPE_UPDATE; - - /** - * Set the document for this bulk update action. - * @param \Elastica\Document $document - * @return \Elastica\Bulk\Action\UpdateDocument - */ - public function setDocument(Document $document) - { - parent::setDocument($document); - - $source = array('doc' => $document->getData()); - - if ($document->getDocAsUpsert()) { - $source['doc_as_upsert'] = true; - - }else if ($document->hasUpsert()) { - - $upsert = $document->getUpsert()->getData(); - - if (!empty($upsert)) { - $source['upsert'] = $upsert; - } - } - - $this->setSource($source); - - return $this; - } - - /** - * @param \Elastica\Script $script - * @return \Elastica\Bulk\Action\AbstractDocument - */ - public function setScript(Script $script) - { - parent::setScript($script); - - $source = $script->toArray(); - - if ($script->hasUpsert()) { - $upsert = $script->getUpsert()->getData(); - - if (!empty($upsert)) { - $source['upsert'] = $upsert; - } - } - - $this->setSource($source); - - return $this; - } -} |