activity = $activity; } /** * Records an entry. * * @since 0.1.0 * * @param string $action Action key such as `order.placed`. * @param int $customer_id Customer the entry belongs to, or 0. * @param string $object_type Object type such as `order`. * @param int $object_id Object id. * @param string $message Message without personal data. * @param array $context Extra data without personal data. * @return void */ public function record( string $action, int $customer_id, string $object_type, int $object_id, string $message, array $context = array() ): void { $this->activity->insert( array( 'actor_id' => get_current_user_id(), 'customer_id' => $customer_id, 'object_type' => $object_type, 'object_id' => $object_id, 'action' => $action, 'message' => $message, 'context' => $context, 'ip_address' => Helpers::client_ip(), ) ); } }