This commit is contained in:
@@ -24,17 +24,22 @@ final class SchoolYearContext
|
||||
|
||||
public function status(): string
|
||||
{
|
||||
return $this->status;
|
||||
return strtolower($this->status);
|
||||
}
|
||||
|
||||
public function isActive(): bool
|
||||
{
|
||||
return $this->status === 'active';
|
||||
return $this->status() === 'active';
|
||||
}
|
||||
|
||||
public function isReadonly(): bool
|
||||
{
|
||||
return in_array($this->status, ['closed', 'archived'], true);
|
||||
return ! $this->isActive();
|
||||
}
|
||||
|
||||
public function isHistorical(): bool
|
||||
{
|
||||
return ! $this->isActive();
|
||||
}
|
||||
|
||||
public function isExplicitSelection(): bool
|
||||
@@ -47,7 +52,7 @@ final class SchoolYearContext
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'name' => $this->yearName,
|
||||
'status' => $this->status,
|
||||
'status' => $this->status(),
|
||||
'readonly' => $this->isReadonly(),
|
||||
'explicitSelection' => $this->explicitSelection,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user