public function markItemAsFailed($item, string $errorMessage = ''): int
    {
        $itemUid = ($item instanceof Item) ? $item->getIndexQueueUid() : (int)$item;
        $errorMessage = empty($errorMessage) ? '1' : $errorMessage;

        $queryBuilder = $this->getQueryBuilder();
        return (int)$queryBuilder
            ->update($this->table)
            ->set('errors', $errorMessage)
            ->where($queryBuilder->expr()->eq('uid', $itemUid))
            ->execute();
    }
public function markItemAsFailed($item, string $errorMessage = ''): int
    {
        $itemUid = ($item instanceof Item) ? $item->getIndexQueueUid() : (int)$item;
        $errorMessage = empty($errorMessage) ? '1' : $errorMessage;

        $queryBuilder = $this->getQueryBuilder();
        return (int)$queryBuilder
            ->update($this->table)
            ->set('errors', $errorMessage)
            ->where($queryBuilder->expr()->eq('uid', $itemUid))
            ->execute();
    }
public function markItemAsFailed ( $ item , string $ errorMessage = '' ) : int { $ itemUid = ( $ item instanceof Item ) ? $ item -> getIndexQueueUid ( ) : ( int ) $ item ; $ errorMessage = empty ( $ errorMessage ) ? '1' : $ errorMessage ; $ queryBuilder = $ this -> getQueryBuilder ( ) ; return ( int ) $ queryBuilder -> update ( $ this -> table ) -> set ( 'errors' , $ errorMessage ) -> where ( $ queryBuilder -> expr ( ) -> eq ( 'uid' , $ itemUid ) ) -> execute ( ) ; }
Marks an item as failed and causes the indexer to skip the item in the
next run.

@param int|Item $item Either the item's Index Queue uid or the complete item
@param string $errorMessage Error message
@return int affected rows
Marks an item as failed and causes the indexer to skip the item in the next run .