mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-03 21:34:59 +00:00
fixes
This commit is contained in:
@@ -23,10 +23,9 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
class ActivityReason
|
||||
{
|
||||
/**
|
||||
* @var bool
|
||||
* @ORM\Column(type="boolean")
|
||||
*/
|
||||
private $active = true;
|
||||
private bool $active = true;
|
||||
|
||||
/**
|
||||
* @var ActivityReasonCategory
|
||||
@@ -34,7 +33,7 @@ class ActivityReason
|
||||
* targetEntity="Chill\ActivityBundle\Entity\ActivityReasonCategory",
|
||||
* inversedBy="reasons")
|
||||
*/
|
||||
private $category;
|
||||
private ?ActivityReasonCategory $category = null;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
@@ -43,13 +42,13 @@ class ActivityReason
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
* @ORM\Column(type="json")
|
||||
*/
|
||||
private $name;
|
||||
private array $name;
|
||||
|
||||
/**
|
||||
* Get active.
|
||||
@@ -81,25 +80,9 @@ class ActivityReason
|
||||
|
||||
/**
|
||||
* Get name.
|
||||
*
|
||||
* @param mixed|null $locale
|
||||
*/
|
||||
public function getName($locale = null): array|string
|
||||
public function getName(): array
|
||||
{
|
||||
if ($locale) {
|
||||
if (isset($this->name[$locale])) {
|
||||
return $this->name[$locale];
|
||||
}
|
||||
|
||||
foreach ($this->name as $name) {
|
||||
if (!empty($name)) {
|
||||
return $name;
|
||||
}
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user