-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathAbstractRemoteEntity.php
95 lines (79 loc) · 3.29 KB
/
AbstractRemoteEntity.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php
/*
* Copyright (C) 2023 SYSTOPIA GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation in version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types = 1);
namespace Civi\RemoteTools\Api4;
use Civi\Api4\Generic\AbstractEntity;
use Civi\RemoteTools\Api4\Action\RemoteCheckAccessAction;
use Civi\RemoteTools\Api4\Action\RemoteDeleteAction;
use Civi\RemoteTools\Api4\Action\RemoteGetAction;
use Civi\RemoteTools\Api4\Action\RemoteGetActions;
use Civi\RemoteTools\Api4\Action\RemoteGetCreateFormAction;
use Civi\RemoteTools\Api4\Action\RemoteGetFieldsAction;
use Civi\RemoteTools\Api4\Action\RemoteGetUpdateFormAction;
use Civi\RemoteTools\Api4\Action\RemoteSubmitCreateFormAction;
use Civi\RemoteTools\Api4\Action\RemoteSubmitUpdateFormAction;
use Civi\RemoteTools\Api4\Action\RemoteValidateCreateFormAction;
use Civi\RemoteTools\Api4\Action\RemoteValidateUpdateFormAction;
/**
* @api
*/
class AbstractRemoteEntity extends AbstractEntity {
/**
* @return \Civi\RemoteTools\Api4\Action\RemoteCheckAccessAction
*/
public static function checkAccess() {
return new RemoteCheckAccessAction(static::getEntityName(), __FUNCTION__);
}
public static function delete(): RemoteDeleteAction {
return new RemoteDeleteAction(static::getEntityName(), __FUNCTION__);
}
public static function get(): RemoteGetAction {
return new RemoteGetAction(static::getEntityName(), __FUNCTION__);
}
/**
* @return \Civi\RemoteTools\Api4\Action\RemoteGetActions
*/
public static function getActions($checkPermissions = TRUE) {
return new RemoteGetActions(static::getEntityName(), __FUNCTION__);
}
/**
* @inheritDoc
*
* @return \Civi\RemoteTools\Api4\Action\RemoteGetFieldsAction
*/
public static function getFields() {
return new RemoteGetFieldsAction(static::getEntityName(), __FUNCTION__);
}
public static function getCreateForm(): RemoteGetCreateFormAction {
return new RemoteGetCreateFormAction(static::getEntityName(), __FUNCTION__);
}
public static function getUpdateForm(): RemoteGetUpdateFormAction {
return new RemoteGetUpdateFormAction(static::getEntityName(), __FUNCTION__);
}
public static function validateCreateForm(): RemoteValidateCreateFormAction {
return new RemoteValidateCreateFormAction(static::getEntityName(), __FUNCTION__);
}
public static function validateUpdateForm(): RemoteValidateUpdateFormAction {
return new RemoteValidateUpdateFormAction(static::getEntityName(), __FUNCTION__);
}
public static function submitCreateForm(): RemoteSubmitCreateFormAction {
return new RemoteSubmitCreateFormAction(static::getEntityName(), __FUNCTION__);
}
public static function submitUpdateForm(): RemoteSubmitUpdateFormAction {
return new RemoteSubmitUpdateFormAction(static::getEntityName(), __FUNCTION__);
}
}