mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-01 06:28:46 +02:00
N°8772 - dynamic form
This commit is contained in:
28
sources/Forms/Block/IO/Format/BooleanIOFormat.php
Normal file
28
sources/Forms/Block/IO/Format/BooleanIOFormat.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Combodo\iTop\Forms\Block\IO\Format;
|
||||
|
||||
use JsonSerializable;
|
||||
|
||||
class BooleanIOFormat implements JsonSerializable
|
||||
{
|
||||
public function __construct(public bool $bValue)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function IsTrue(): bool
|
||||
{
|
||||
return $this->bValue;
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->bValue ? 'true' : 'false';
|
||||
}
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
return $this->bValue;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user