28 lines
474 B
PHP
28 lines
474 B
PHP
|
<?php
|
||
|
|
||
|
/**
|
||
|
* Languages
|
||
|
*
|
||
|
* Holds all available Language objects for the site
|
||
|
*/
|
||
|
class Languages extends Collection {
|
||
|
|
||
|
protected $site = null;
|
||
|
|
||
|
public function __construct($site) {
|
||
|
return $this->site = $site;
|
||
|
}
|
||
|
|
||
|
public function find($code) {
|
||
|
return isset($this->data[$code]) ? $this->data[$code] : null;
|
||
|
}
|
||
|
|
||
|
public function codes() {
|
||
|
return $this->keys();
|
||
|
}
|
||
|
|
||
|
public function findDefault() {
|
||
|
return $this->site->defaultLanguage();
|
||
|
}
|
||
|
|
||
|
}
|