3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
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 |
9 +--------------------------------------------------------------------+
12 namespace Civi\Api4\Generic\Traits
;
15 * Trait for Entities not intended to be publicly writable.
17 trait ReadOnlyEntity
{
20 * Not intended to be used outside CiviCRM core code.
25 public static function save($checkPermissions = TRUE) {
26 return parent
::save($checkPermissions);
30 * Not intended to be used outside CiviCRM core code.
35 public static function create($checkPermissions = TRUE) {
36 return parent
::create($checkPermissions);
40 * Not intended to be used outside CiviCRM core code.
45 public static function update($checkPermissions = TRUE) {
46 return parent
::update($checkPermissions);
50 * Not intended to be used outside CiviCRM core code.
55 public static function delete($checkPermissions = TRUE) {
56 return parent
::delete($checkPermissions);
60 * Not intended to be used outside CiviCRM core code.
65 public static function replace($checkPermissions = TRUE) {
66 return parent
::replace($checkPermissions);
72 public static function permissions() {
73 $permissions = parent
::permissions();
74 $permissions['create'] = $permissions['update'] = $permissions['delete'] = \CRM_Core_Permission
::ALWAYS_DENY_PERMISSION
;