Scriptlog Docs

Scriptlog Documentation

Code reference for the Scriptlog codebase

User Tools

Site Tools


scriptlog:lib:dao:languagedao

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

scriptlog:lib:dao:languagedao [2026/09/26 09:09] – admin adminscriptlog:lib:dao:languagedao [2026/09/26 09:16] (current) – admin admin
Line 16: Line 16:
 ======= Docblock Metadata ======= ======= Docblock Metadata =======
  
-  ^ Tag ^ Value ^ +^ Tag ^ Value ^ 
-  | ''@category'' | DAO Class | +| ''@category'' | DAO Class | 
-  | ''@author'' | M.Noermoehammad | +| ''@author'' | M.Noermoehammad | 
-  | ''@license'' | MIT | +| ''@license'' | MIT | 
-  | ''@version'' | 1.0 | +| ''@version'' | 1.0 | 
-  | ''@since'' | Since Release 1.0 |+| ''@since'' | Since Release 1.0 |
  
 ======= Inheritance ======= ======= Inheritance =======
  
-  ^ Relation ^ Type ^ Meaning ^ +^ Relation ^ Type ^ Meaning ^ 
-  | extends | [[scriptlog:lib:core:dao|''Dao'']] | parent class/interface |+| extends | [[scriptlog:lib:core:dao|''Dao'']] | parent class/interface |
  
 ======= Constants (0) ======= ======= Constants (0) =======
Line 38: Line 38:
 ======= Methods (11) ======= ======= Methods (11) =======
  
-  ^ Visibility ^ Method ^ Summary ^ Line ^ +^ Visibility ^ Method ^ Summary ^ Line ^ 
-  | public | ''createLanguage()'' | Create a new language record. | 44 | +| public | ''createLanguage()'' | Create a new language record. | 44 | 
-  | public | ''findById()'' | Find a language record by its primary key. | 66 | +| public | ''findById()'' | Find a language record by its primary key. | 66 | 
-  | public | ''findLanguageByCode()'' | Find a language record by its unique language code. | 79 | +| public | ''findLanguageByCode()'' | Find a language record by its unique language code. | 79 | 
-  | public | ''findActiveLanguages()'' | Find all active language records. | 94 | +| public | ''findActiveLanguages()'' | Find all active language records. | 94 | 
-  | public | ''findDefaultLanguage()'' | Find the default language record. | 108 | +| public | ''findDefaultLanguage()'' | Find the default language record. | 108 | 
-  | public | ''updateLanguage()'' | Update an existing language record. | 125 | +| public | ''updateLanguage()'' | Update an existing language record. | 125 | 
-  | public | ''setDefaultLanguage()'' | Mark a language as the site's default. | 140 | +| public | ''setDefaultLanguage()'' | Mark a language as the site's default. | 140 | 
-  | public | ''deleteLanguage()'' | Delete a language record by its primary key. | 152 | +| public | ''deleteLanguage()'' | Delete a language record by its primary key. | 152 | 
-  | public | ''countLanguages()'' | Count all language records. | 162 | +| public | ''countLanguages()'' | Count all language records. | 162 | 
-  | public | ''codeExists()'' | Check whether a language code already exists. | 177 | +| public | ''codeExists()'' | Check whether a language code already exists. | 177 | 
-  | public | ''findAllLanguages()'' | Find all language records, active or not. | 192 |+| public | ''findAllLanguages()'' | Find all language records, active or not. | 192 |
  
  
Line 67: Line 67:
 `lang_sort` (0), `lang_is_default` (0), `lang_is_active` (1). `lang_sort` (0), `lang_is_default` (0), `lang_is_active` (1).
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$data'' | ''array'' | //required// | //none// |+|  ''$data'' |  ''array'' |  //required// |  //none// |
  
 **Returns:** ''int'' — int The ID of the newly created language record **Returns:** ''int'' — int The ID of the newly created language record
Line 83: Line 83:
 Find a language record by its primary key. Find a language record by its primary key.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$id'' | ''int'' | //required// | The language ID |+|  ''$id'' |  ''int'' |  //required// |  The language ID |
  
 **Returns:** ''?array'' — array<string, mixed>&#124;null The language row, or null when not found **Returns:** ''?array'' — array<string, mixed>&#124;null The language row, or null when not found
Line 99: Line 99:
 Find a language record by its unique language code. Find a language record by its unique language code.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$code'' | ''string'' | //required// | The language code, e.g. 'en' or 'ar' |+|  ''$code'' |  ''string'' |  //required// |  The language code, e.g. 'en' or 'ar' |
  
 **Returns:** ''?array'' — array<string, mixed>&#124;null The language row, or null when not found **Returns:** ''?array'' — array<string, mixed>&#124;null The language row, or null when not found
Line 151: Line 151:
 ignored by the database wrapper. ignored by the database wrapper.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$id'' | ''int'' | //required// | The language ID to update | +|  ''$id'' |  ''int'' |  //required// |  The language ID to update | 
-  | ''$data'' | ''array'' | //required// | //none// |+|  ''$data'' |  ''array'' |  //required// |  //none// |
  
 **Returns:** ''void'' — void **Returns:** ''void'' — void
Line 172: Line 172:
 language ID, guaranteeing exactly one default at a time. language ID, guaranteeing exactly one default at a time.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$id'' | ''int'' | //required// | The language ID to promote to default |+|  ''$id'' |  ''int'' |  //required// |  The language ID to promote to default |
  
 **Returns:** ''void'' — void **Returns:** ''void'' — void
Line 188: Line 188:
 Delete a language record by its primary key. Delete a language record by its primary key.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$id'' | ''int'' | //required// | The language ID to delete |+|  ''$id'' |  ''int'' |  //required// |  The language ID to delete |
  
 **Returns:** ''void'' — void **Returns:** ''void'' — void
Line 221: Line 221:
 Useful for uniqueness validation before insert or update operations. Useful for uniqueness validation before insert or update operations.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$code'' | ''string'' | //required// | The language code to check, e.g. 'en' |+|  ''$code'' |  ''string'' |  //required// |  The language code to check, e.g. 'en' |
  
 **Returns:** ''bool'' — bool True when the code already exists, false otherwise **Returns:** ''bool'' — bool True when the code already exists, false otherwise
Line 246: Line 246:
 ======= Imports ======= ======= Imports =======
  
-  ^ Alias ^ Fully-qualified name ^ +^ Alias ^ Fully-qualified name ^ 
-  | ''Dao'' | [[scriptlog:lib:core:dao&#124;''Scriptlog\Core\Dao'']] |+| ''Dao'' | [[scriptlog:lib:core:dao|''Scriptlog\Core\Dao'']] |
  
  
scriptlog/lib/dao/languagedao.txt · Last modified: by admin