- More work done on Update, Insert and Delete clause
- Added TOP property to select and delete to fit MSSQL limit's term. - Added a new interface allowing object's manipulation on save() and load() queries
This commit is contained in:
1 parent
3dc82b1f0d
commit
2f43fb4559
13 files changed
+169
-58
No files matched your search
@@ -2,11 +2,30 @@
|
||||
|
||||
namespace Ulmus\Entity\Field;
|
||||
|
||||
class Datetime extends \DateTime {
|
||||
use Ulmus\Entity\EntityObjectInterface;
|
||||
|
||||
class Datetime extends \DateTime implements EntityObjectInterface {
|
||||
|
||||
public function load(...$arguments)
|
||||
{
|
||||
$value = $arguments[0];
|
||||
|
||||
# From Timestamp
|
||||
if ( is_numeric($value) ) {
|
||||
return new static("@$value");
|
||||
}
|
||||
|
||||
return new static($value);
|
||||
}
|
||||
|
||||
public function save()
|
||||
{
|
||||
return $this->getTimestamp();
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
return $this->format("Y-m-d H:i:s");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user