Files
oficial/app/common/Implement/Repository/Mapper/Boolean.php
2023-08-08 23:53:49 -04:00

18 lines
430 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)
{
$this->setFunction(function($data) use ($column) {
return $data[$column] !== 0;
});
if ($property !== null) {
$this->setProperty($property);
}
}
}