Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion classes/sprig/field/nativetimestamp.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@
*
* @package Sprig
* @author Marcus Cobden
* @author Tomasz Jaskowski
* @copyright (c) 2010 Marcus Cobden
* @license MIT
*/
class Sprig_Field_NativeTimestamp extends Sprig_Field_Timestamp {

public function _database_wrap($value)
{
return new Database_Expression('FROM_UNIXTIME('. (int) $value . ')');
if ($value === null) {
return new Database_Expression('NULL');
} else {
return new Database_Expression('FROM_UNIXTIME('. (int) $value . ')');
}
}

public function _database_unwrap($value)
Expand Down