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 | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/vendor/ruflin/elastica/lib/Elastica/Bulk/Action/UpdateDocument.php b/vendor/ruflin/elastica/lib/Elastica/Bulk/Action/UpdateDocument.php index 4c1dbaa4..2b133acb 100644 --- a/vendor/ruflin/elastica/lib/Elastica/Bulk/Action/UpdateDocument.php +++ b/vendor/ruflin/elastica/lib/Elastica/Bulk/Action/UpdateDocument.php @@ -1,14 +1,9 @@ <?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 { /** @@ -18,8 +13,10 @@ class UpdateDocument extends IndexDocument /** * Set the document for this bulk update action. + * * @param \Elastica\Document $document - * @return \Elastica\Bulk\Action\UpdateDocument + * + * @return $this */ public function setDocument(Document $document) { @@ -28,10 +25,8 @@ class UpdateDocument extends IndexDocument $source = array('doc' => $document->getData()); if ($document->getDocAsUpsert()) { - $source['doc_as_upsert'] = true; - - }else if ($document->hasUpsert()) { - + $source['doc_as_upsert'] = true; + } elseif ($document->hasUpsert()) { $upsert = $document->getUpsert()->getData(); if (!empty($upsert)) { @@ -46,7 +41,8 @@ class UpdateDocument extends IndexDocument /** * @param \Elastica\Script $script - * @return \Elastica\Bulk\Action\AbstractDocument + * + * @return $this */ public function setScript(Script $script) { |