APIv4 - Refactor writeObjects to choose BAO function based on annotations
[civicrm-core.git] / Civi / Api4 / Contact.php
index 34f6463f5530f8c5f28962f67c3330352255d88f..800d8f6aec9b37f3686f280d594bdbe73e2679d8 100644 (file)
@@ -26,6 +26,24 @@ namespace Civi\Api4;
  */
 class Contact extends Generic\DAOEntity {
 
+  /**
+   * @param bool $checkPermissions
+   * @return Action\Contact\Update
+   */
+  public static function update($checkPermissions = TRUE) {
+    return (new Action\Contact\Update(__CLASS__, __FUNCTION__))
+      ->setCheckPermissions($checkPermissions);
+  }
+
+  /**
+   * @param bool $checkPermissions
+   * @return Action\Contact\Save
+   */
+  public static function save($checkPermissions = TRUE) {
+    return (new Action\Contact\Save(__CLASS__, __FUNCTION__))
+      ->setCheckPermissions($checkPermissions);
+  }
+
   /**
    * @param bool $checkPermissions
    * @return Action\Contact\Delete