WordLinkingService
in package
Service for managing word-to-text-item relationships.
Handles:
- Linking words to text items after creation
- Bulk linking operations
- Retrieving term data from text items
Tags
Table of Contents
Methods
- getTermFromTextItem() : array<string|int, mixed>|null
- Get term data from a text item at a specific position.
- getWordAtPosition() : string|null
- Get word text at a specific position in text.
- linkAllTextItems() : void
- Link all unlinked text items to their corresponding words.
- linkNewWordsToTextItems() : void
- Link newly created words to text items.
- linkToTextItems() : void
- Link word to text items after creation.
Methods
getTermFromTextItem()
Get term data from a text item at a specific position.
public
getTermFromTextItem(int $textId, int $ord) : array<string|int, mixed>|null
Parameters
- $textId : int
-
Text ID
- $ord : int
-
Word order/position
Return values
array<string|int, mixed>|null —Term data with Ti2Text and Ti2LgID
getWordAtPosition()
Get word text at a specific position in text.
public
getWordAtPosition(int $textId, int $ord) : string|null
Parameters
- $textId : int
-
Text ID
- $ord : int
-
Position in text
Return values
string|null —Word text or null if not found
linkAllTextItems()
Link all unlinked text items to their corresponding words.
public
linkAllTextItems() : void
linkNewWordsToTextItems()
Link newly created words to text items.
public
linkNewWordsToTextItems(int $maxWoId) : void
Links words with ID greater than maxWoId to their corresponding text items.
Parameters
- $maxWoId : int
-
Maximum word ID before bulk insert
linkToTextItems()
Link word to text items after creation.
public
linkToTextItems(int $wordId, int $langId, string $textlc) : void
Parameters
- $wordId : int
-
Word ID
- $langId : int
-
Language ID
- $textlc : string
-
Lowercase text