mirror of
https://github.com/processwire/processwire.git
synced 2025-08-12 09:44:38 +02:00
Minor documentation updates in Language and Languages classes
This commit is contained in:
@@ -125,8 +125,10 @@ class Language extends Page {
|
|||||||
* See the `Languages::setLocale()` method for full details.
|
* See the `Languages::setLocale()` method for full details.
|
||||||
*
|
*
|
||||||
* @param int $category Optional category (default=LC_ALL)
|
* @param int $category Optional category (default=LC_ALL)
|
||||||
|
* @return string|bool Returns the locale that was set or boolean false if requested locale cannot be set.
|
||||||
* @see Languages::setLocale()
|
* @see Languages::setLocale()
|
||||||
*
|
*
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
public function setLocale($category = LC_ALL) {
|
public function setLocale($category = LC_ALL) {
|
||||||
return $this->wire('languages')->setLocale($category, $this);
|
return $this->wire('languages')->setLocale($category, $this);
|
||||||
|
@@ -368,7 +368,7 @@ class Languages extends PagesType {
|
|||||||
* - If you call with no arguments, it returns the current user language, same as `$user->language`, but using this
|
* - If you call with no arguments, it returns the current user language, same as `$user->language`, but using this
|
||||||
* method may be preferable in some contexts, depending on how your IDE understands API calls.
|
* method may be preferable in some contexts, depending on how your IDE understands API calls.
|
||||||
*
|
*
|
||||||
* @param string $name Specify language name (or ID) to get a specific language, or omit to get current language
|
* @param string|int $name Specify language name (or ID) to get a specific language, or omit to get current language
|
||||||
* @return Language|NullPage|null
|
* @return Language|NullPage|null
|
||||||
* @since 3.0.127
|
* @since 3.0.127
|
||||||
*
|
*
|
||||||
@@ -747,12 +747,27 @@ class Languages extends PagesType {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function __get($key) {
|
public function __get($key) {
|
||||||
if($key == 'tabs') return $this->wire('modules')->get('LanguageSupport')->getLanguageTabs();
|
if($key === 'tabs') return $this->wire()->modules->get('LanguageSupport')->getLanguageTabs();
|
||||||
if($key == 'default') return $this->getDefault();
|
if($key === 'default') return $this->getDefault();
|
||||||
if($key == 'support') return $this->wire('modules')->get('LanguageSupport');
|
if($key === 'support') return $this->wire()->modules->get('LanguageSupport');
|
||||||
return parent::__get($key);
|
return parent::__get($key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get language or property
|
||||||
|
*
|
||||||
|
* (method repeated here for return value documentation purposes only)
|
||||||
|
*
|
||||||
|
* #pw-internal
|
||||||
|
*
|
||||||
|
* @param int|string $key
|
||||||
|
* @return Language|NullPage|null|mixed
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function get($key) {
|
||||||
|
return parent::get($key);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hook to WireDatabasePDO::unknownColumnError
|
* Hook to WireDatabasePDO::unknownColumnError
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user