APIv4 - Support pseudoconstant lookups
[civicrm-core.git] / Civi / Api4 / Generic / DAOEntity.php
CommitLineData
19b53e5b
C
1<?php
2
380f3545
TO
3/*
4 +--------------------------------------------------------------------+
41498ac5 5 | Copyright CiviCRM LLC. All rights reserved. |
380f3545 6 | |
41498ac5
TO
7 | This work is published under the GNU AGPLv3 license with some |
8 | permitted exceptions and without any warranty. For full license |
9 | and copyright information, see https://civicrm.org/licensing |
380f3545
TO
10 +--------------------------------------------------------------------+
11 */
12
13/**
14 *
15 * @package CRM
ca5cec67 16 * @copyright CiviCRM LLC https://civicrm.org/licensing
380f3545
TO
17 * $Id$
18 *
19 */
20
21
19b53e5b
C
22namespace Civi\Api4\Generic;
23
24/**
25 * Base class for DAO-based entities.
26 */
27abstract class DAOEntity extends AbstractEntity {
28
29 /**
30 * @return DAOGetAction
31 */
32 public static function get() {
33 return new DAOGetAction(static::class, __FUNCTION__);
34 }
35
36 /**
121ec912 37 * @return DAOSaveAction
19b53e5b
C
38 */
39 public static function save() {
40 return new DAOSaveAction(static::class, __FUNCTION__);
41 }
42
43 /**
44 * @return DAOGetFieldsAction
45 */
46 public static function getFields() {
47 return new DAOGetFieldsAction(static::class, __FUNCTION__);
48 }
49
50 /**
51 * @return DAOCreateAction
52 */
53 public static function create() {
54 return new DAOCreateAction(static::class, __FUNCTION__);
55 }
56
57 /**
58 * @return DAOUpdateAction
59 */
60 public static function update() {
61 return new DAOUpdateAction(static::class, __FUNCTION__);
62 }
63
64 /**
65 * @return DAODeleteAction
66 */
67 public static function delete() {
68 return new DAODeleteAction(static::class, __FUNCTION__);
69 }
70
71 /**
72 * @return BasicReplaceAction
73 */
74 public static function replace() {
75 return new BasicReplaceAction(static::class, __FUNCTION__);
76 }
77
78}