Add in APIv4 Logging Entity
authorMonish Deb <monish.deb@jmaconsulting.biz>
Tue, 23 Nov 2021 12:32:32 +0000 (18:02 +0530)
committerColeman Watts <coleman@civicrm.org>
Fri, 8 Apr 2022 00:23:04 +0000 (20:23 -0400)
CRM/Core/BAO/Log.php
Civi/Api4/Log.php [new file with mode: 0644]

index 382fbb5c31678dd07d96bdc5aa5b4d63f80b897c..719245f55cb867464762b35437ef85350d2d720d 100644 (file)
@@ -56,13 +56,13 @@ class CRM_Core_BAO_Log extends CRM_Core_DAO_Log {
    *
    * @param array $params
    *   Array of name-value pairs of log table.
-   *
+   * @return CRM_Core_DAO_Log
    */
   public static function add(&$params) {
-
     $log = new CRM_Core_DAO_Log();
     $log->copyValues($params);
     $log->save();
+    return $log;
   }
 
   /**
diff --git a/Civi/Api4/Log.php b/Civi/Api4/Log.php
new file mode 100644 (file)
index 0000000..862cc83
--- /dev/null
@@ -0,0 +1,22 @@
+<?php
+/*
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC. All rights reserved.                        |
+ |                                                                    |
+ | This work is published under the GNU AGPLv3 license with some      |
+ | permitted exceptions and without any warranty. For full license    |
+ | and copyright information, see https://civicrm.org/licensing       |
+ +--------------------------------------------------------------------+
+ */
+namespace Civi\Api4;
+
+/**
+ * Log
+ *
+ * @since 5.49
+ * @package Civi\Api4
+ */
+class Log extends Generic\DAOEntity {
+  use Generic\Traits\ReadOnlyEntity;
+
+}