Commit | Line | Data |
---|---|---|
19b53e5b C |
1 | <?php |
2 | ||
3 | namespace Civi\Api4\Generic; | |
4 | ||
5 | /** | |
6 | * Base class for DAO-based entities. | |
7 | */ | |
8 | abstract class DAOEntity extends AbstractEntity { | |
9 | ||
10 | /** | |
11 | * @return DAOGetAction | |
12 | */ | |
13 | public static function get() { | |
14 | return new DAOGetAction(static::class, __FUNCTION__); | |
15 | } | |
16 | ||
17 | /** | |
18 | * @return DAOGetAction | |
19 | */ | |
20 | public static function save() { | |
21 | return new DAOSaveAction(static::class, __FUNCTION__); | |
22 | } | |
23 | ||
24 | /** | |
25 | * @return DAOGetFieldsAction | |
26 | */ | |
27 | public static function getFields() { | |
28 | return new DAOGetFieldsAction(static::class, __FUNCTION__); | |
29 | } | |
30 | ||
31 | /** | |
32 | * @return DAOCreateAction | |
33 | */ | |
34 | public static function create() { | |
35 | return new DAOCreateAction(static::class, __FUNCTION__); | |
36 | } | |
37 | ||
38 | /** | |
39 | * @return DAOUpdateAction | |
40 | */ | |
41 | public static function update() { | |
42 | return new DAOUpdateAction(static::class, __FUNCTION__); | |
43 | } | |
44 | ||
45 | /** | |
46 | * @return DAODeleteAction | |
47 | */ | |
48 | public static function delete() { | |
49 | return new DAODeleteAction(static::class, __FUNCTION__); | |
50 | } | |
51 | ||
52 | /** | |
53 | * @return BasicReplaceAction | |
54 | */ | |
55 | public static function replace() { | |
56 | return new BasicReplaceAction(static::class, __FUNCTION__); | |
57 | } | |
58 | ||
59 | } |