find($activityId); } /** * Inserts a new activity record in the database * * @param string $type * @param integer $actorId * @param integer $targetActorId * @param integer $noteId * @param string $payload * @param \CodeIgniter\I18n\Time $scheduledAt * @param string $status * * @return Michalsn\Uuid\BaseResult|int|string|false */ public function newActivity( $type, $actorId, $targetActorId, $noteId, $payload, $scheduledAt = null, $status = null ) { return $this->insert( [ 'actor_id' => $actorId, 'target_actor_id' => $targetActorId, 'note_id' => $noteId, 'type' => $type, 'payload' => $payload, 'scheduled_at' => $scheduledAt, 'status' => $status, ], true, ); } public function getScheduledActivities() { return $this->where('`scheduled_at` <= NOW()', null, false) ->where('status', 'queued') ->orderBy('scheduled_at', 'ASC') ->findAll(); } }