2023-09-12
This commit is contained in:
@ -5,11 +5,12 @@ use Incoviba\Common\Implement\Repository\Mapper;
|
||||
|
||||
class Boolean extends Mapper
|
||||
{
|
||||
public function __construct(string $column, ?string $property = null)
|
||||
public function __construct(string $column, ?string $property = null, bool $default = false)
|
||||
{
|
||||
$this->setFunction(function($data) use ($column) {
|
||||
return $data[$column] !== 0;
|
||||
});
|
||||
$this->setDefault($default);
|
||||
if ($property !== null) {
|
||||
$this->setProperty($property);
|
||||
}
|
||||
|
Reference in New Issue
Block a user