Files
oficial/app/common/Implement/Repository/Mapper/Boolean.php

18 lines
430 B
PHP
Raw Normal View History

<?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);
}
}
}