forked from pmishev/ElasticsearchBundle
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Track persisted entities and update their ids when they are created in ES * Fixed Symfony version to 3.2.* as 3.3.0 is breaking the KNP paginator dependency on the translator service * Raised phpcs version to 3.* * code style fixes * Updated .travis.yml
- Loading branch information
Showing
18 changed files
with
458 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Sineflow\ElasticsearchBundle\Event; | ||
|
||
/** | ||
* Class Events | ||
*/ | ||
final class Events | ||
{ | ||
/** | ||
* Dispatched on persisting an entity via the index manager | ||
*/ | ||
const PRE_PERSIST = 'sfes.pre_persist'; | ||
|
||
/** | ||
* Dispatched after a bulk request is submitted to Elasticsearch | ||
*/ | ||
const POST_COMMIT = 'sfes.post_commit'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace Sineflow\ElasticsearchBundle\Event; | ||
|
||
use Symfony\Component\EventDispatcher\Event; | ||
|
||
/** | ||
* Class PostCommitEvent | ||
*/ | ||
class PostCommitEvent extends Event | ||
{ | ||
/** | ||
* @var array | ||
*/ | ||
private $bulkResponse; | ||
|
||
/** | ||
* @param array $bulkResponse | ||
*/ | ||
public function __construct(array $bulkResponse) | ||
{ | ||
$this->bulkResponse = $bulkResponse; | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function getBulkResponse() | ||
{ | ||
return $this->bulkResponse; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
namespace Sineflow\ElasticsearchBundle\Event; | ||
|
||
use Sineflow\ElasticsearchBundle\Document\DocumentInterface; | ||
use Symfony\Component\EventDispatcher\Event; | ||
|
||
/** | ||
* Class PrePersistEvent | ||
*/ | ||
class PrePersistEvent extends Event | ||
{ | ||
/** | ||
* @var DocumentInterface | ||
*/ | ||
private $document; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
private $bulkOperationIndex; | ||
|
||
/** | ||
* @param DocumentInterface $document | ||
* @param int $bulkOperationIndex | ||
*/ | ||
public function __construct(DocumentInterface $document, $bulkOperationIndex) | ||
{ | ||
$this->document = $document; | ||
$this->bulkOperationIndex = $bulkOperationIndex; | ||
} | ||
|
||
/** | ||
* @return DocumentInterface | ||
*/ | ||
public function getDocument() | ||
{ | ||
return $this->document; | ||
} | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getBulkOperationIndex() | ||
{ | ||
return $this->bulkOperationIndex; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.