Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
civirules
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
ayduns
civirules
Commits
602f450b
Commit
602f450b
authored
10 years ago
by
Erik Hommel
Browse files
Options
Downloads
Patches
Plain Diff
added abstract api entity and action methods
parent
1b91a3d5
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CRM/Civirules/Action.php
+18
-2
18 additions, 2 deletions
CRM/Civirules/Action.php
CRM/CivirulesActions/GroupContact.php
+20
-0
20 additions, 0 deletions
CRM/CivirulesActions/GroupContact.php
CRM/CivirulesConditions/FirstContribution.php
+3
-0
3 additions, 0 deletions
CRM/CivirulesConditions/FirstContribution.php
with
41 additions
and
2 deletions
CRM/Civirules/Action.php
+
18
−
2
View file @
602f450b
...
...
@@ -12,6 +12,22 @@ abstract class CRM_Civirules_Action {
protected
$action
=
array
();
/**
* Method to get the api entity to process in this CiviRule action
*
* @access protected
* @abstract
*/
protected
abstract
function
getApiEntity
();
/**
* Method to get the api action to process in this CiviRule action
*
* @access protected
* @abstract
*/
protected
abstract
function
getApiAction
();
/**
* Method to set RuleActionData
*
...
...
@@ -55,8 +71,8 @@ abstract class CRM_Civirules_Action {
* @access public
*/
public
function
processAction
(
CRM_Civirules_EventData_EventData
$eventData
)
{
$entity
=
$this
->
action
[
'api_e
ntity
'
]
;
$action
=
$this
->
action
[
'api_a
ction
'
]
;
$entity
=
$this
->
getApiE
ntity
()
;
$action
=
$this
->
getApiA
ction
()
;
$params
=
$this
->
getActionParameters
();
...
...
This diff is collapsed.
Click to expand it.
CRM/CivirulesActions/GroupContact.php
+
20
−
0
View file @
602f450b
...
...
@@ -50,4 +50,24 @@ class CRM_CivirulesActions_GroupContact extends CRM_Civirules_Action {
}
return
''
;
}
/**
* Method to set the api entity
*
* @return string
* @access protected
*/
protected
function
getApiEntity
()
{
return
'GroupContact'
;
}
/**
* Method to set the api action
*
* @return string
* @access protected
*/
protected
function
getApiAction
()
{
return
'create'
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
CRM/CivirulesConditions/FirstContribution.php
+
3
−
0
View file @
602f450b
...
...
@@ -48,4 +48,7 @@ class CRM_CivirulesConditions_FirstContribution extends CRM_Civirules_Condition
public
function
getExtraDataInputUrl
(
$ruleConditionId
)
{
return
FALSE
;
}
public
function
requiredEntities
()
{
return
array
(
'Contribution'
);
}
}
\ No newline at end of file
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