<?php
namespace Josegonzalez\Upload\Database\Type;

use Cake\Database\Driver;
use Cake\Database\Type;

class FileType extends Type
{
    /**
     * Marshalls flat data into PHP objects.
     *
     * Most useful for converting request data into PHP objects
     * that make sense for the rest of the ORM/Database layers.
     *
     * @param mixed $value The value to convert.
     * @return mixed Converted value.
     */
    public function marshal($value)
    {
        return $value;
    }

    /**
     * {@inheritDoc}
     */
    public function toDatabase($value, Driver $driver)
    {
        return $value;
    }

    /**
     * {@inheritDoc}
     */
    public function toPHP($value, Driver $driver)
    {
        return $value;
    }
}
