}
$io->table(
- ['UserId', 'Path', 'RemindAt', 'Notified'],
+ ['UserId', 'Path', 'RemindAt', 'CreatedAt', 'Notified'],
array_map(
fn (RichReminder $reminder) => [
$reminder->getUserId(),
$reminder->getNode()->getPath(),
$reminder->getRemindAt()->format(DateTimeInterface::ATOM), // ISO 8601
+ $reminder->getCreatedAt()->format(DateTimeInterface::ATOM), // ISO 8601
$reminder->getNotified() ? 'true' : 'false',
],
$reminders,
* @method void setRemindAt(DateTime $remindAt)
* @method DateTime getRemindAt()
*
+ * @method void setCreatedAt(DateTime $createdAt)
+ * @method DateTime getCreatedAt()
+ *
* @method void setNotified(bool $notified)
* @method bool getNotified()
*/
protected $userId;
protected $fileId;
protected $remindAt;
+ protected $createdAt;
protected $notified = false;
public function __construct() {
$this->addType('userId', 'string');
$this->addType('fileId', 'integer');
$this->addType('remindAt', 'datetime');
+ $this->addType('createdAt', 'datetime');
$this->addType('notified', 'boolean');
}
}
public function find(int $id): Reminder {
$qb = $this->db->getQueryBuilder();
- $qb->select('user_id', 'file_id', 'remind_at', 'notified')
- ->from($this->getTableName())
+ $qb->select('user_id', 'file_id', 'remind_at', 'created_at', 'notified')
+ ->from($this->getTableName())
->where($qb->expr()->eq('id', $qb->createNamedParameter($id, IQueryBuilder::PARAM_INT)));
return $this->findEntity($qb);
public function findAll() {
$qb = $this->db->getQueryBuilder();
- $qb->select('user_id', 'file_id', 'remind_at', 'notified')
+ $qb->select('user_id', 'file_id', 'remind_at', 'created_at', 'notified')
->from($this->getTableName())
->orderBy('remind_at', 'ASC');
public function findAllForUser(IUser $user) {
$qb = $this->db->getQueryBuilder();
- $qb->select('user_id', 'file_id', 'remind_at', 'notified')
- ->from($this->getTableName())
+ $qb->select('user_id', 'file_id', 'remind_at', 'created_at', 'notified')
+ ->from($this->getTableName())
->where($qb->expr()->eq('user_id', $qb->createNamedParameter($user->getUID(), IQueryBuilder::PARAM_STR)))
->orderBy('remind_at', 'ASC');
public function findToRemind() {
$qb = $this->db->getQueryBuilder();
- $qb->select('user_id', 'file_id', 'remind_at', 'notified')
+ $qb->select('user_id', 'file_id', 'remind_at', 'created_at', 'notified')
->from($this->getTableName())
->where($qb->expr()->lt('remind_at', $qb->createFunction('NOW()')))
->andWhere($qb->expr()->eq('notified', $qb->createNamedParameter(false, IQueryBuilder::PARAM_BOOL)))
public function findToDelete(?int $limit = null) {
$qb = $this->db->getQueryBuilder();
- $qb->select('user_id', 'file_id', 'remind_at', 'notified')
+ $qb->select('user_id', 'file_id', 'remind_at', 'created_at', 'notified')
->from($this->getTableName())
->where($qb->expr()->eq('notified', $qb->createNamedParameter(true, IQueryBuilder::PARAM_BOOL)))
->orderBy('remind_at', 'ASC')