From 07422810f7294186b45f8da3b2f4e605e2b1e5a0 Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 24 Mar 2021 16:25:08 +1300 Subject: [PATCH] Remove toArray function as it does the same as the parent --- CRM/ACL/BAO/ACL.php | 54 ++++++++------------------------------------- 1 file changed, 9 insertions(+), 45 deletions(-) diff --git a/CRM/ACL/BAO/ACL.php b/CRM/ACL/BAO/ACL.php index 24b7a49ac6fe..18bc8023aa64 100644 --- a/CRM/ACL/BAO/ACL.php +++ b/CRM/ACL/BAO/ACL.php @@ -19,57 +19,21 @@ * Access Control List */ class CRM_ACL_BAO_ACL extends CRM_ACL_DAO_ACL { - /** - * @var string - */ - public static $_entityTable = NULL; - public static $_objectTable = NULL; - public static $_operation = NULL; - - public static $_fieldKeys = NULL; /** * Available operations for pseudoconstant. * * @return array */ - public static function operation() { - if (!self::$_operation) { - self::$_operation = [ - 'View' => ts('View'), - 'Edit' => ts('Edit'), - 'Create' => ts('Create'), - 'Delete' => ts('Delete'), - 'Search' => ts('Search'), - 'All' => ts('All'), - ]; - } - return self::$_operation; - } - - /** - * Construct an associative array of an ACL rule's properties - * - * @param string $format - * Sprintf format for array. - * @param bool $hideEmpty - * Only return elements that have a value set. - * - * @return array - * Assoc. array of the ACL rule's properties - */ - public function toArray($format = '%s', $hideEmpty = FALSE) { - $result = []; - - if (!self::$_fieldKeys) { - $fields = CRM_ACL_DAO_ACL::fields(); - self::$_fieldKeys = array_keys($fields); - } - - foreach (self::$_fieldKeys as $field) { - $result[$field] = $this->$field; - } - return $result; + public static function operation(): array { + return [ + 'View' => ts('View'), + 'Edit' => ts('Edit'), + 'Create' => ts('Create'), + 'Delete' => ts('Delete'), + 'Search' => ts('Search'), + 'All' => ts('All'), + ]; } /**