Documentation

GetLanguageById

Use case for retrieving a language by ID.

Tags
since
3.0.0

Table of Contents

Properties

$repository  : LanguageRepositoryInterface

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

Methods

execute()

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
bool

isDuplicateName()

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
bool

toViewObject()

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


        
On this page

Search results