Files
Juan Pablo Vial 0cd357b6cb 2023-09-12
2023-09-13 18:51:46 -03:00

19 lines
490 B
PHP

<?php
namespace Incoviba\Common\Implement\Repository\Mapper;
use Incoviba\Common\Implement\Repository\Mapper;
class Boolean extends Mapper
{
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);
}
}
}