WordBulkService
in package
Service for batch operations on multiple words.
Handles:
- Bulk deletion
- Bulk status updates
- Bulk text transformations
- Bulk term saving
Tags
Table of Contents
Methods
- bulkSaveTerms() : int
- Save multiple terms in bulk.
- capitalizeMultiple() : int
- Capitalize words.
- deleteMultiple() : int
- Delete multiple words.
- deleteSentencesMultiple() : int
- Delete sentences for multiple words.
- getNewWordsAfter() : array<int, array<string, mixed>>
- Get newly created words after bulk insert.
- toLowercaseMultiple() : int
- Convert words to lowercase.
- updateStatusDateMultiple() : int
- Update status changed date for multiple words.
- updateStatusMultiple() : int
- Update status for multiple words.
Methods
bulkSaveTerms()
Save multiple terms in bulk.
public
bulkSaveTerms(array<int, array{lg: int, text: string, status: int, trans?: string}> $terms) : int
Used by the bulk translate feature to save multiple words at once.
Parameters
- $terms : array<int, array{lg: int, text: string, status: int, trans?: string}>
-
Array of term data
Return values
int —The max word ID before insertion (for finding new words)
capitalizeMultiple()
Capitalize words.
public
capitalizeMultiple(array<string|int, int> $wordIds) : int
Parameters
- $wordIds : array<string|int, int>
-
Array of word IDs
Return values
int —Number of updated words
deleteMultiple()
Delete multiple words.
public
deleteMultiple(array<string|int, int> $wordIds) : int
Parameters
- $wordIds : array<string|int, int>
-
Array of word IDs to delete
Return values
int —Number of deleted words
deleteSentencesMultiple()
Delete sentences for multiple words.
public
deleteSentencesMultiple(array<string|int, int> $wordIds) : int
Parameters
- $wordIds : array<string|int, int>
-
Array of word IDs
Return values
int —Number of updated words
getNewWordsAfter()
Get newly created words after bulk insert.
public
getNewWordsAfter(int $maxWoId) : array<int, array<string, mixed>>
Parameters
- $maxWoId : int
-
The max word ID before insertion
Return values
array<int, array<string, mixed>> —Array of rows with WoID, WoTextLC, WoStatus, WoTranslation
toLowercaseMultiple()
Convert words to lowercase.
public
toLowercaseMultiple(array<string|int, int> $wordIds) : int
Parameters
- $wordIds : array<string|int, int>
-
Array of word IDs
Return values
int —Number of updated words
updateStatusDateMultiple()
Update status changed date for multiple words.
public
updateStatusDateMultiple(array<string|int, int> $wordIds) : int
Parameters
- $wordIds : array<string|int, int>
-
Array of word IDs
Return values
int —Number of updated words
updateStatusMultiple()
Update status for multiple words.
public
updateStatusMultiple(array<string|int, int> $wordIds, int $status[, bool $relative = false ]) : int
Parameters
- $wordIds : array<string|int, int>
-
Array of word IDs
- $status : int
-
New status value (1-5, 98, 99)
- $relative : bool = false
-
If true, change status by +1 or -1
Return values
int —Number of updated words