18 lines
430 B
PHP
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);
|
||
|
}
|
||
|
}
|
||
|
}
|