Merge pull request #22955 from colemanw/schemaTrait
[civicrm-core.git] / Civi / Api4 / Contact.php
CommitLineData
19b53e5b 1<?php
380f3545
TO
2/*
3 +--------------------------------------------------------------------+
41498ac5 4 | Copyright CiviCRM LLC. All rights reserved. |
380f3545 5 | |
41498ac5
TO
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
380f3545
TO
9 +--------------------------------------------------------------------+
10 */
19b53e5b
C
11namespace Civi\Api4;
12
13/**
14 * Contacts - Individuals, Organizations, Households.
15 *
16 * This is the central entity in the CiviCRM database, and links to
17 * many other entities (Email, Phone, Participant, etc.).
18 *
19 * Creating a new contact requires at minimum a name or email address.
20 *
0493ec47 21 * @see https://docs.civicrm.org/user/en/latest/organising-your-data/contacts/
aa998597 22 * @searchable primary
076fe09a 23 * @orderBy sort_name
d44cc3cb 24 * @since 5.19
19b53e5b
C
25 * @package Civi\Api4
26 */
27class Contact extends Generic\DAOEntity {
28
ed3f5877
CW
29 /**
30 * @param bool $checkPermissions
31 * @return Action\Contact\Create
32 */
33 public static function create($checkPermissions = TRUE) {
34 return (new Action\Contact\Create(__CLASS__, __FUNCTION__))
35 ->setCheckPermissions($checkPermissions);
36 }
37
5a443458
CW
38 /**
39 * @param bool $checkPermissions
40 * @return Action\Contact\Update
41 */
42 public static function update($checkPermissions = TRUE) {
43 return (new Action\Contact\Update(__CLASS__, __FUNCTION__))
44 ->setCheckPermissions($checkPermissions);
45 }
46
47 /**
48 * @param bool $checkPermissions
49 * @return Action\Contact\Save
50 */
51 public static function save($checkPermissions = TRUE) {
52 return (new Action\Contact\Save(__CLASS__, __FUNCTION__))
53 ->setCheckPermissions($checkPermissions);
54 }
55
a0edf1cb
CW
56 /**
57 * @param bool $checkPermissions
58 * @return Action\Contact\Delete
59 */
60 public static function delete($checkPermissions = TRUE) {
61 return (new Action\Contact\Delete(__CLASS__, __FUNCTION__))
62 ->setCheckPermissions($checkPermissions);
63 }
64
e15f9453 65 /**
6764a9d3
CW
66 * @param bool $checkPermissions
67 * @return Action\Contact\GetChecksum
e15f9453 68 */
6764a9d3
CW
69 public static function getChecksum($checkPermissions = TRUE) {
70 return (new Action\Contact\GetChecksum(__CLASS__, __FUNCTION__))
71 ->setCheckPermissions($checkPermissions);
19b53e5b
C
72 }
73
e15f9453 74 /**
6764a9d3
CW
75 * @param bool $checkPermissions
76 * @return Action\Contact\ValidateChecksum
e15f9453 77 */
6764a9d3
CW
78 public static function validateChecksum($checkPermissions = TRUE) {
79 return (new Action\Contact\ValidateChecksum(__CLASS__, __FUNCTION__))
80 ->setCheckPermissions($checkPermissions);
19b53e5b
C
81 }
82
83}