Hi,
Mongo has many types of date object (for example ISODate()
).
For example I have MobileUsers
:
/**
* Class MobileUsers
*/
class MobileUsers extends \Phalcon\Mvc\Collection
{
/**
* @var string
*/
public $user_id;
/**
* @var array
*/
public $devices;
/**
* @return string
*/
public $created_at;
/**
* @return string
*/
public $updated_at;
public function getSource()
{
return "users";
}
public function beforeCreate()
{
$this->created_at = date('Y-m-d H:i:s');
}
public function beforeUpdate()
{
$this->updated_at = date('Y-m-d H:i:s');
}
}
How to use ISODate instead string with ODM?