<?php
namespace Claromentis\Core\ORM\Caster;

$GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"] = (@$GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"] ?: array()) + array();
use Date;
use DateDay;




class Accessor implements CasterInterface
{
    use CasterTrait;
    
    
    
    
    
    
    
    public function castBool($value)
    {
        return (bool) $value;
    }
    
    
    
    
    
    
    
    public function castInt($value)
    {
        return (int) $value;
    }
    
    
    
    
    
    
    
    public function castFloat($value)
    {
        return (float) $value;
    }
    
    
    
    
    
    
    
    public function castString($value)
    {
        return (string) $value;
    }
    
    
    
    
    
    
    
    public function castClob($value)
    {
        return $this->castString($value);
    }
    
    
    
    
    
    
    
    public function castDate($value)
    {
        if ($value instanceof Date) {
            return $value;
        }
        return new Date($value);
    }
    
    
    
    
    
    
    
    public function castDateDay($value)
    {
        if ($value instanceof DateDay) {
            return $value;
        }
        return new DateDay($value);
    }
}