Skip to content

Commit

Permalink
Removed some deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
allanmcarvalho committed Mar 1, 2019
1 parent a534fb1 commit 6f5bc4e
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions src/Database/Type/FileType.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@
*
* @author allan
*/
use Cake\Database\Type;

use Cake\Database\Driver;
use Cake\Database\Exception;
use Cake\Database\Type;
use Cake\Database\TypeInterface;

class FileType extends Type
class FileType extends Type implements TypeInterface
{

/**
Expand Down Expand Up @@ -53,4 +56,31 @@ public function marshal($value)
return $value;
}

/**
* Casts given value from a PHP type to one acceptable by a database.
*
* @param mixed $value Value to be converted to a database equivalent.
* @param \Cake\Database\Driver $driver Object from which database preferences and configuration will be extracted.
* @return mixed Given PHP type casted to one acceptable by a database.
*/
public function toDatabase($value, Driver $driver)
{
return $value;
}

/**
* Casts given value from a database type to a PHP equivalent.
*
* @param mixed $value Value to be converted to PHP equivalent
* @param \Cake\Database\Driver $driver Object from which database preferences and configuration will be extracted
* @return mixed Given value casted from a database to a PHP equivalent.
*/
public function toPHP($value, Driver $driver)
{
if ($value === null) {
return null;
}

return (string)$value;
}
}

0 comments on commit 6f5bc4e

Please sign in to comment.