GetLanguageById
in package
Use case for retrieving a language by ID.
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- createEmpty() : Language
- Create an empty language object with default values.
- execute() : Language|null
- Get a language by ID.
- exists() : bool
- Check if a language exists by ID.
- isDuplicateName() : bool
- Check if a language name is duplicate.
- toViewObject() : stdClass
- Convert a Language entity to a view object (stdClass) for templates.
Properties
$repository
private
LanguageRepositoryInterface
$repository
Methods
__construct()
public
__construct([LanguageRepositoryInterface|null $repository = null ]) : mixed
Parameters
- $repository : LanguageRepositoryInterface|null = null
-
Repository instance
createEmpty()
Create an empty language object with default values.
public
createEmpty() : Language
Return values
Languageexecute()
Get a language by ID.
public
execute(int $id) : Language|null
Parameters
- $id : int
-
Language ID
Return values
Language|null —Language entity or null if not found
exists()
Check if a language exists by ID.
public
exists(int $id) : bool
Parameters
- $id : int
-
Language ID
Return values
boolisDuplicateName()
Check if a language name is duplicate.
public
isDuplicateName(string $name[, int $excludeLgId = 0 ]) : bool
Parameters
- $name : string
-
Language name
- $excludeLgId : int = 0
-
Language ID to exclude from check (for updates)
Return values
booltoViewObject()
Convert a Language entity to a view object (stdClass) for templates.
public
toViewObject(Language $language) : stdClass
Parameters
- $language : Language
-
The Language entity
Return values
stdClass —View object with public properties