Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
CiviCRM Core
Commits
29a0c5ce
Commit
29a0c5ce
authored
3 years ago
by
Monish Deb
Browse files
Options
Downloads
Patches
Plain Diff
ACLEntityRole tidy fixes
parent
f96e4983
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CRM/ACL/BAO/ACLEntityRole.php
+9
-19
9 additions, 19 deletions
CRM/ACL/BAO/ACLEntityRole.php
with
9 additions
and
19 deletions
CRM/ACL/BAO/ACLEntityRole.php
+
9
−
19
View file @
29a0c5ce
...
...
@@ -19,7 +19,6 @@
* Access Control AclRole.
*/
class
CRM_ACL_BAO_ACLEntityRole
extends
CRM_ACL_DAO_ACLEntityRole
{
public
static
$_entityTable
=
NULL
;
/**
* Whitelist of possible values for the entity_table field
...
...
@@ -27,13 +26,10 @@ class CRM_ACL_BAO_ACLEntityRole extends CRM_ACL_DAO_ACLEntityRole {
* @return array
*/
public
static
function
entityTables
():
array
{
if
(
!
self
::
$_entityTable
)
{
self
::
$_entityTable
=
[
'civicrm_contact'
=>
ts
(
'Contact'
),
'civicrm_group'
=>
ts
(
'Group'
),
];
}
return
self
::
$_entityTable
;
return
[
'civicrm_contact'
=>
ts
(
'Contact'
),
'civicrm_group'
=>
ts
(
'Group'
),
];
}
/**
...
...
@@ -42,10 +38,7 @@ class CRM_ACL_BAO_ACLEntityRole extends CRM_ACL_DAO_ACLEntityRole {
* @return CRM_ACL_DAO_EntityRole
*/
public
static
function
create
(
&
$params
)
{
$dao
=
new
CRM_ACL_DAO_EntityRole
();
$dao
->
copyValues
(
$params
);
$dao
->
save
();
return
$dao
;
return
self
::
writeRecord
(
$params
);
}
/**
...
...
@@ -53,7 +46,7 @@ class CRM_ACL_BAO_ACLEntityRole extends CRM_ACL_DAO_ACLEntityRole {
* @param $defaults
*/
public
static
function
retrieve
(
&
$params
,
&
$defaults
)
{
CRM_Core_DAO
::
commonRetrieve
(
'CRM_ACL_DAO_EntityRole'
,
$params
,
$defaults
);
CRM_Core_DAO
::
commonRetrieve
(
__CLASS__
,
$params
,
$defaults
);
}
/**
...
...
@@ -68,21 +61,18 @@ class CRM_ACL_BAO_ACLEntityRole extends CRM_ACL_DAO_ACLEntityRole {
* true if we found and updated the object, else false
*/
public
static
function
setIsActive
(
$id
,
$is_active
)
{
return
CRM_Core_DAO
::
setFieldValue
(
'CRM_ACL_DAO_EntityRole'
,
$id
,
'is_active'
,
$is_active
);
return
CRM_Core_DAO
::
setFieldValue
(
__CLASS__
,
$id
,
'is_active'
,
$is_active
);
}
/**
* Delete Entity Role records.
* Delete
Dedupe
Entity Role records.
*
* @param int $entityRoleId
* ID of the EntityRole record to be deleted.
*
*/
public
static
function
del
(
$entityRoleId
)
{
$entityDAO
=
new
CRM_ACL_DAO_EntityRole
();
$entityDAO
->
id
=
$entityRoleId
;
$entityDAO
->
find
(
TRUE
);
$entityDAO
->
delete
();
return
parent
::
deleteRecord
([
'id'
=>
$entityRoleId
]);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment