Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Developer Documentation
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
brienne
Developer Documentation
Commits
3f3298e1
Commit
3f3298e1
authored
8 years ago
by
Andie Hunt
Browse files
Options
Downloads
Patches
Plain Diff
hook_civicrm_managed: fixed formatting
parent
6bf706e4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/hooks/hook_civicrm_managed.md
+52
-40
52 additions, 40 deletions
docs/hooks/hook_civicrm_managed.md
with
52 additions
and
40 deletions
docs/hooks/hook_civicrm_managed.md
+
52
−
40
View file @
3f3298e1
...
@@ -13,40 +13,50 @@ Installation](http://civicrm.org/blogs/totten/api-and-art-installation).
...
@@ -13,40 +13,50 @@ Installation](http://civicrm.org/blogs/totten/api-and-art-installation).
## Definition
## Definition
hook_civicrm_managed(&$entities)
```
php
hook_civicrm_managed
(
&
$entities
)
```
## Parameters
## Parameters
-
array $entities - the list of entity declarations; each declaration
-
array
`$entities`
- the list of entity declarations; each declaration
is an array with these following keys:
\
is an array with these following keys:
-
'module': string; for module-extensions, this is the
fully-qualifed name (e.g. "
*com.example.mymodule*
"); for Drupal
- string `module` - for module-extensions, this is the
modules, the name is prefixed by "drupal" (e.g.
fully-qualifed name (e.g. `com.example.mymodule`); for Drupal
*"drupal.mymodule*
")
modules, the name is prefixed by `drupal` (e.g.
-
'name': string, a symbolic name which can be used to track this
`drupal.mymodule`)
- string `name` - a symbolic name which can be used to track this
entity (*Note: Each module creates its own namespace*)
entity (*Note: Each module creates its own namespace*)
-
'entity': string, an entity-type supported by the
[
CiviCRM
- string `entity` - an entity-type supported by the [CiviCRM
API](https://wiki.civicrm.org/confluence/display/CRMDOC/API+Reference) (*Note: this
API](https://wiki.civicrm.org/confluence/display/CRMDOC/API+Reference) (*Note: this
currently must be an entity which supports the 'is_active'
currently must be an entity which supports the 'is_active'
property*)
property*)
-
'params': array, the entity data as supported by the
[
CiviCRM
- array `params` - the entity data as supported by the [CiviCRM
API](https://wiki.civicrm.org/confluence/display/CRMDOC/API+Reference)
API](https://wiki.civicrm.org/confluence/display/CRMDOC/API+Reference)
-
'update' (
**v4.5+**
): string, a policy which describes when to
- string `update` - a policy which describes when to
update records
update records
-
'always' (
**default**
): always update the managed-entity
record; changes in $entities will override any local
- `always` (**default**): always update the managed-entity
record; changes in `$entities` will override any local
changes (eg by the site-admin)
changes (eg by the site-admin)
-
'
never
'
: never update the managed-entity record; changes
-
`
never
`
: never update the managed-entity record; changes
made locally (eg by the site-admin) will override changes in
made locally (eg by the site-admin) will override changes in
$entities
`$entities`
-
'cleanup' (
**v4.5+**
): string, a policy which describes whether
to cleanup the record when it becomes orphaned (ie when
- string `cleanup` - a policy which describes whether
$entities no longer references the record)
\
to cleanup the record when it becomes orphaned (i.e. when
-
'always' (
**default**
): always delete orphaned records
$entities no longer references the record)
-
'never': never delete orphaned records
-
'unused': only delete orphaned records if there are no other
- `always` (**default**): always delete orphaned records
- `never`: never delete orphaned records
- `unused`: only delete orphaned records if there are no other
references to it in the DB. (This is determined by calling
references to it in the DB. (This is determined by calling
the API's
"
getrefcount
"
action.)
the API's
`
getrefcount
`
action.)
## Returns
## Returns
...
@@ -54,21 +64,23 @@ Installation](http://civicrm.org/blogs/totten/api-and-art-installation).
...
@@ -54,21 +64,23 @@ Installation](http://civicrm.org/blogs/totten/api-and-art-installation).
## Example
## Example
/**
```
php
* Declare a report-template which should be activated whenever this module is enabled
/**
*/
* Declare a report-template which should be activated whenever this module is enabled
function modulename_civicrm_managed(&$entities) {
*/
$entities[] = array(
function
modulename_civicrm_managed
(
&
$entities
)
{
'module' => 'com.example.modulename',
$entities
[]
=
array
(
'name' => 'myreport',
'module'
=>
'com.example.modulename'
,
'entity' => 'ReportTemplate',
'name'
=>
'myreport'
,
'params' => array(
'entity'
=>
'ReportTemplate'
,
'version' => 3,
'params'
=>
array
(
'label' => 'Example Report',
'version'
=>
3
,
'description' => 'Longish description of the example report',
'label'
=>
'Example Report'
,
'class_name' => 'CRM_Modulename_Report_Form_Sybunt',
'description'
=>
'Longish description of the example report'
,
'report_url' => 'mymodule/mysbunt',
'class_name'
=>
'CRM_Modulename_Report_Form_Sybunt'
,
'component' => 'CiviContribute',
'report_url'
=>
'mymodule/mysbunt'
,
),
'component'
=>
'CiviContribute'
,
);
),
}
);
\ 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