Cast ids to integer for fulltextsearch

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2019-04-10 11:31:20 +02:00
parent bcc48d08c8
commit 6af28f1b79

View File

@@ -92,7 +92,7 @@ class FullTextSearchService {
* @param GenericEvent $e * @param GenericEvent $e
*/ */
public function onCardCreated(GenericEvent $e) { public function onCardCreated(GenericEvent $e) {
$cardId = $e->getArgument('id'); $cardId = (int)$e->getArgument('id');
$userId = $e->getArgument('userId'); $userId = $e->getArgument('userId');
$this->fullTextSearchManager->createIndex( $this->fullTextSearchManager->createIndex(
@@ -105,7 +105,7 @@ class FullTextSearchService {
* @param GenericEvent $e * @param GenericEvent $e
*/ */
public function onCardUpdated(GenericEvent $e) { public function onCardUpdated(GenericEvent $e) {
$cardId = $e->getArgument('id'); $cardId = (int)$e->getArgument('id');
$this->fullTextSearchManager->updateIndexStatus( $this->fullTextSearchManager->updateIndexStatus(
DeckProvider::DECK_PROVIDER_ID, (string)$cardId, IIndex::INDEX_CONTENT DeckProvider::DECK_PROVIDER_ID, (string)$cardId, IIndex::INDEX_CONTENT
@@ -117,7 +117,7 @@ class FullTextSearchService {
* @param GenericEvent $e * @param GenericEvent $e
*/ */
public function onCardDeleted(GenericEvent $e) { public function onCardDeleted(GenericEvent $e) {
$cardId = $e->getArgument('id'); $cardId = (int)$e->getArgument('id');
$this->fullTextSearchManager->updateIndexStatus( $this->fullTextSearchManager->updateIndexStatus(
DeckProvider::DECK_PROVIDER_ID, (string)$cardId, IIndex::INDEX_REMOVE DeckProvider::DECK_PROVIDER_ID, (string)$cardId, IIndex::INDEX_REMOVE
@@ -129,7 +129,7 @@ class FullTextSearchService {
* @param GenericEvent $e * @param GenericEvent $e
*/ */
public function onBoardShares(GenericEvent $e) { public function onBoardShares(GenericEvent $e) {
$boardId = $e->getArgument('boardId'); $boardId = (int)$e->getArgument('boardId');
$cards = array_map( $cards = array_map(
function(Card $item) { function(Card $item) {