diff options
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; - } -} |