mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-01 04:23:49 +00:00
Activity Reasons, Activity Reasons Category, Activity Types in Translatable strings
This commit is contained in:
@@ -33,9 +33,9 @@ class ActivityReason
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @var array
|
||||
*/
|
||||
private $label;
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @var ActivityReasonCategory
|
||||
@@ -59,29 +59,42 @@ class ActivityReason
|
||||
}
|
||||
|
||||
/**
|
||||
* Set label
|
||||
* Set name
|
||||
*
|
||||
* @param string $label
|
||||
* @param array $name
|
||||
*
|
||||
* @return ActivityReason
|
||||
*/
|
||||
public function setLabel($label)
|
||||
public function setName($name)
|
||||
{
|
||||
$this->label = $label;
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get label
|
||||
* Get name
|
||||
*
|
||||
* @return string
|
||||
* @return array | string
|
||||
*/
|
||||
public function getLabel()
|
||||
public function getName($locale = null)
|
||||
{
|
||||
return $this->label;
|
||||
if ($locale) {
|
||||
if (isset($this->name[$locale])) {
|
||||
return $this->name[$locale];
|
||||
} else {
|
||||
foreach ($this->name as $name) {
|
||||
if (!empty($name)) {
|
||||
return $name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return '';
|
||||
} else {
|
||||
return $this->name;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set category
|
||||
*
|
||||
|
@@ -33,12 +33,18 @@ class ActivityReasonCategory
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $label;
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*/
|
||||
private $active;
|
||||
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
return 'blop';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@@ -52,27 +58,40 @@ class ActivityReasonCategory
|
||||
}
|
||||
|
||||
/**
|
||||
* Set label
|
||||
* Set name
|
||||
*
|
||||
* @param string $label
|
||||
* @param array $name
|
||||
*
|
||||
* @return ActivityReasonCategory
|
||||
*/
|
||||
public function setLabel($label)
|
||||
public function setName($name)
|
||||
{
|
||||
$this->label = $label;
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get label
|
||||
* Get name
|
||||
*
|
||||
* @return string
|
||||
* @return array
|
||||
*/
|
||||
public function getLabel()
|
||||
public function getName($locale = null)
|
||||
{
|
||||
return $this->label;
|
||||
if ($locale) {
|
||||
if (isset($this->name[$locale])) {
|
||||
return $this->name[$locale];
|
||||
} else {
|
||||
foreach ($this->name as $name) {
|
||||
if (!empty($name)) {
|
||||
return $name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return '';
|
||||
} else {
|
||||
return $this->name;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -31,7 +31,7 @@ class ActivityType
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @var array
|
||||
*/
|
||||
private $name;
|
||||
|
||||
@@ -49,7 +49,7 @@ class ActivityType
|
||||
/**
|
||||
* Set name
|
||||
*
|
||||
* @param string $name
|
||||
* @param array $name
|
||||
*
|
||||
* @return ActivityType
|
||||
*/
|
||||
@@ -63,11 +63,24 @@ class ActivityType
|
||||
/**
|
||||
* Get name
|
||||
*
|
||||
* @return string
|
||||
* @return array | string
|
||||
*/
|
||||
public function getName()
|
||||
public function getName($locale = null)
|
||||
{
|
||||
return $this->name;
|
||||
if ($locale) {
|
||||
if (isset($this->name[$locale])) {
|
||||
return $this->name[$locale];
|
||||
} else {
|
||||
foreach ($this->name as $name) {
|
||||
if (!empty($name)) {
|
||||
return $name;
|
||||
}
|
||||
}
|
||||
}
|
||||
return '';
|
||||
} else {
|
||||
return $this->name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user