summaryrefslogtreecommitdiff
path: root/www/crm/wp-content/plugins/civicrm/civicrm/ext/api4/Civi/Api4/Contact.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/crm/wp-content/plugins/civicrm/civicrm/ext/api4/Civi/Api4/Contact.php')
-rw-r--r--www/crm/wp-content/plugins/civicrm/civicrm/ext/api4/Civi/Api4/Contact.php39
1 files changed, 39 insertions, 0 deletions
diff --git a/www/crm/wp-content/plugins/civicrm/civicrm/ext/api4/Civi/Api4/Contact.php b/www/crm/wp-content/plugins/civicrm/civicrm/ext/api4/Civi/Api4/Contact.php
new file mode 100644
index 00000000..cca8c335
--- /dev/null
+++ b/www/crm/wp-content/plugins/civicrm/civicrm/ext/api4/Civi/Api4/Contact.php
@@ -0,0 +1,39 @@
+<?php
+
+namespace Civi\Api4;
+
+/**
+ * Contacts - Individuals, Organizations, Households.
+ *
+ * This is the central entity in the CiviCRM database, and links to
+ * many other entities (Email, Phone, Participant, etc.).
+ *
+ * Creating a new contact requires at minimum a name or email address.
+ *
+ * @package Civi\Api4
+ */
+class Contact extends Generic\DAOEntity {
+
+ /**
+ * @return Action\Contact\Create
+ */
+ public static function create() {
+ return new Action\Contact\Create(__CLASS__, __FUNCTION__);
+ }
+
+ /**
+ * @return \Civi\Api4\Generic\DAOUpdateAction
+ */
+ public static function update() {
+ // For some reason the contact bao requires this for updating
+ return new Generic\DAOUpdateAction(__CLASS__, __FUNCTION__, ['id', 'contact_type']);
+ }
+
+ /**
+ * @return \Civi\Api4\Action\Contact\GetFields
+ */
+ public static function getFields() {
+ return new Action\Contact\GetFields(__CLASS__, __FUNCTION__);
+ }
+
+}