-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add float type; needs test; closes #5
- Loading branch information
Rasmus Schultz
committed
May 23, 2016
1 parent
7d0a28b
commit 4715406
Showing
4 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace mindplay\sql\model\types; | ||
|
||
use mindplay\sql\model\schema\Type; | ||
|
||
class FloatType implements Type | ||
{ | ||
public function convertToSQL($value) | ||
{ | ||
return $value === null | ||
? null | ||
: (string) $value; | ||
} | ||
|
||
public function convertToPHP($value) | ||
{ | ||
return $value === null | ||
? null | ||
: (float) $value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters