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
4c35651e
Commit
4c35651e
authored
3 years ago
by
Monish Deb
Browse files
Options
Downloads
Patches
Plain Diff
Add APIv4 Batch.create spec
parent
8250d5d1
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Civi/Api4/Service/Spec/Provider/BatchCreationSpecProvider.php
+43
-0
43 additions, 0 deletions
.../Api4/Service/Spec/Provider/BatchCreationSpecProvider.php
api/v3/Batch.php
+0
-5
0 additions, 5 deletions
api/v3/Batch.php
with
43 additions
and
5 deletions
Civi/Api4/Service/Spec/Provider/BatchCreationSpecProvider.php
0 → 100644
+
43
−
0
View file @
4c35651e
<?php
/*
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC. All rights reserved. |
| |
| This work is published under the GNU AGPLv3 license with some |
| permitted exceptions and without any warranty. For full license |
| and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/
/**
*
* @package CRM
* @copyright CiviCRM LLC https://civicrm.org/licensing
*/
namespace
Civi\Api4\Service\Spec\Provider
;
use
Civi\Api4\Service\Spec\RequestSpec
;
class
BatchCreationSpecProvider
implements
Generic\SpecProviderInterface
{
/**
* @inheritDoc
*/
public
function
modifySpec
(
RequestSpec
$spec
)
{
$spec
->
getFieldByName
(
'created_id'
)
->
setDefaultValue
(
'user_contact_id'
);
$spec
->
getFieldByName
(
'created_date'
)
->
setDefaultValue
(
'now'
);
$spec
->
getFieldByName
(
'modified_id'
)
->
setDefaultValue
(
'user_contact_id'
);
$spec
->
getFieldByName
(
'modified_date'
)
->
setDefaultValue
(
'now'
);
}
/**
* @inheritDoc
*/
public
function
applies
(
$entity
,
$action
)
{
return
$entity
===
'Batch'
&&
$action
===
'create'
;
}
}
This diff is collapsed.
Click to expand it.
api/v3/Batch.php
+
0
−
5
View file @
4c35651e
...
...
@@ -37,11 +37,6 @@ function civicrm_api3_batch_create($params) {
* Array of parameters determined by getfields.
*/
function
_civicrm_api3_batch_create_spec
(
&
$params
)
{
//@todo - the entity table field looks like it is not actually required & should probably be removed (or a description added if
// it is actually required)
$params
[
'entity_table'
][
'api.default'
]
=
"civicrm_batch"
;
$params
[
'entity_table'
][
'type'
]
=
CRM_Utils_Type
::
T_STRING
;
$params
[
'entity_table'
][
'title'
]
=
'Batch Entity Table - remove?'
;
$params
[
'created_id'
][
'api.default'
]
=
'user_contact_id'
;
$params
[
'created_date'
][
'api.default'
]
=
'now'
;
$params
[
'modified_id'
][
'api.default'
]
=
'user_contact_id'
;
...
...
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