summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2016-06-10 11:50:34 +0200
committeremkael <emkael@tlen.pl>2016-06-10 11:50:34 +0200
commit2b5232a1193356e4bb9ad2d9234735890cd32eaa (patch)
treed0207379d1473bf15874985314709f039de2089f
parentb47a81da8fbf6b6384c8b068132b257835ffff01 (diff)
* DTO for language selection
-rw-r--r--app/frontend/dto/LanguageDTO.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/frontend/dto/LanguageDTO.php b/app/frontend/dto/LanguageDTO.php
new file mode 100644
index 0000000..fa39d03
--- /dev/null
+++ b/app/frontend/dto/LanguageDTO.php
@@ -0,0 +1,19 @@
+<?php
+
+class LanguageDTO {
+
+ public $Label;
+ public $Name;
+
+ public function __construct(string $name) {
+ $this->Name = $name;
+ $this->Label = Locale::getDisplayLanguage($this->Name);
+ }
+
+ public static function __compare(LanguageDTO $l1, LanguageDTO $l2) {
+ return strcmp($l1->Name, $l2->Name);
+ }
+
+}
+
+?>