本文整理汇总了PHP中_civicrm_api3_object_to_array函数的典型用法代码示例。如果您正苦于以下问题:PHP _civicrm_api3_object_to_array函数的具体用法?PHP _civicrm_api3_object_to_array怎么用?PHP _civicrm_api3_object_to_array使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_civicrm_api3_object_to_array函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: civicrm_api3_website_create
/**
* Add an Website for a contact
*
* Allowed @params array keys are:
* {@getfields website_create}
* @example WebsiteCreate.php
* {@example WebsiteCreate.php}
*
* @return array of newly created website property values.
* @access public
* @todo convert to using basic create - BAO function non-std
*/
function civicrm_api3_website_create($params)
{
$websiteBAO = CRM_Core_BAO_Website::add($params);
$values = array();
_civicrm_api3_object_to_array($websiteBAO, $values[$websiteBAO->id]);
return civicrm_api3_create_success($values, $params, 'website', 'get');
}
示例2: civicrm_api3_uf_group_create
/**
* Use this API to create a new group. See the CRM Data Model for uf_group property definitions
*
* @param $params array Associative array of property name/value pairs to insert in group.
*
* @return Newly create $ufGroupArray array
* {@getfields UFGroup_create}
* @example UFGroupCreate.php
* @access public
*/
function civicrm_api3_uf_group_create($params)
{
$ids = array();
$ids['ufgroup'] = $params['id'];
$ufGroup = CRM_Core_BAO_UFGroup::add($params, $ids);
_civicrm_api3_object_to_array($ufGroup, $ufGroupArray[$ufGroup->id]);
return civicrm_api3_create_success($ufGroupArray, $params);
}
示例3: civicrm_api3_website_create
/**
* Add an Website for a contact.
*
* @param array $params
*
* @return array
* API result array.
* @todo convert to using basic create - BAO function non-std
*/
function civicrm_api3_website_create($params)
{
//DO NOT USE THIS FUNCTION AS THE BASIS FOR A NEW API http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
$websiteBAO = CRM_Core_BAO_Website::add($params);
$values = array();
_civicrm_api3_object_to_array($websiteBAO, $values[$websiteBAO->id]);
return civicrm_api3_create_success($values, $params, 'Website', 'get');
}
示例4: civicrm_api3_group_organization_create
/**
* @example GroupOrganizationCreate.php
* {@getfields GroupOrganization_create}
*
* @param $params array
*
* @return array
*
*/
function civicrm_api3_group_organization_create($params)
{
$groupOrgBAO = CRM_Contact_BAO_GroupOrganization::add($params);
if (is_null($groupOrgBAO)) {
return civicrm_api3_create_error("group organization not created");
}
_civicrm_api3_object_to_array($groupOrgBAO, $values);
return civicrm_api3_create_success($values, $params, 'group_organization', 'get', $groupOrgBAO);
}
示例5: civicrm_api3_payment_processor_type_create
/**
* Create payment_processor type.
*
* @param array $params
* Associative array of property name/value pairs to insert in new payment_processor type.
*
* @return array
*/
function civicrm_api3_payment_processor_type_create($params)
{
if (isset($params['id']) && !CRM_Utils_Rule::integer($params['id'])) {
return civicrm_api3_create_error('Invalid value for payment_processor type ID');
}
$paymentProcessorType = CRM_Financial_BAO_PaymentProcessorType::create($params);
$relType = array();
_civicrm_api3_object_to_array($paymentProcessorType, $relType[$paymentProcessorType->id]);
return civicrm_api3_create_success($relType, $params, 'PaymentProcessorType', 'create', $paymentProcessorType);
}
示例6: civicrm_api3_price_field_value_create
/**
* Create or update a price_field_value
*
* @param array $params Associative array of property
* name/value pairs to insert in new 'price_field_value'
* @example PriceFieldValueCreate.php Std Create example
*
* @return array api result array
* {@getfields price_field_value_create}
* @access public
*/
function civicrm_api3_price_field_value_create($params)
{
$ids = array();
if (!empty($params['id'])) {
$ids['id'] = $params['id'];
}
$bao = CRM_Price_BAO_PriceFieldValue::create($params, $ids);
$values = array();
_civicrm_api3_object_to_array($bao, $values[$bao->id]);
return civicrm_api3_create_success($values, $params, 'price_field_value', 'create', $bao);
}
示例7: civicrm_api3_participant_payment_create
/**
* Create a Event Participant Payment
*
* This API is used for creating a Participant Payment of Event.
* Required parameters : participant_id, contribution_id.
*
* @param array $params an associative array of name/value property values of civicrm_participant_payment
* @example ParticipantPaymentCreate.php
* {@example ParticipantPaymentCreate.php 0}
*
* @return array of newly created payment property values.
* {@getfields ParticipantPayment_create}
* @access public
*/
function civicrm_api3_participant_payment_create($params)
{
$ids = array();
if (!empty($params['id'])) {
$ids['id'] = $params['id'];
}
$participantPayment = CRM_Event_BAO_ParticipantPayment::create($params, $ids);
$payment = array();
_civicrm_api3_object_to_array($participantPayment, $payment[$participantPayment->id]);
return civicrm_api3_create_success($payment, $params);
}
示例8: civicrm_api3_option_group_create
/**
* create/update survey
*
* This API is used to create new survey or update any of the existing
* In case of updating existing survey, id of that particular survey must
* be in $params array.
*
* @param array $params (referance) Associative array of property
* name/value pairs to insert in new 'survey'
*
* @return array survey array
*
* @access public
*/
function civicrm_api3_option_group_create($params)
{
$ids = array();
$bao = CRM_Core_BAO_OptionGroup::add($params, $ids);
if (is_null($bao)) {
return civicrm_api3_create_error('Entity not created');
} else {
$values = array();
_civicrm_api3_object_to_array($bao, $values[$bao->id]);
return civicrm_api3_create_success($values, $params, 'option_group', 'create', $bao);
}
}
示例9: civicrm_api3_activity_type_create
/**
* Create activity type.
*
* @param array $params
*
* @return array
* created / updated activity type
*
* @deprecated use the OptionValue api instead
*/
function civicrm_api3_activity_type_create($params)
{
$action = 1;
$groupParams = array('name' => 'activity_type');
if ($optionValueID = CRM_Utils_Array::value('option_value_id', $params)) {
$action = 2;
}
$activityObject = CRM_Core_OptionValue::addOptionValue($params, $groupParams, $action, $optionValueID);
$activityType = array();
_civicrm_api3_object_to_array($activityObject, $activityType[$activityObject->id]);
return civicrm_api3_create_success($activityType, $params, 'activity_type', 'create');
}
示例10: civicrm_api3_dashboard_create
/**
* Creates or updates an Dashlet.
*
* @param array $params Associative array of property name/value
* pairs for the Dashlet.
*
* @return array Array containing 'is_error' to denote success or failure and details of the created activity
*
*/
function civicrm_api3_dashboard_create($params)
{
if (empty($params['id'])) {
civicrm_api3_verify_one_mandatory($params, NULL, array('name', 'label', 'url', 'fullscreen_url'));
}
// create dashboard element
$dashboardBAO = CRM_Core_BAO_Dashboard::addDashlet($params);
if (isset($dashboardBAO->id)) {
_civicrm_api3_object_to_array($dashboardBAO, $dashboardArray[$dashboardBAO->id]);
return civicrm_api3_create_success($dashboardArray, $params, 'dashboard', 'create', $dashboardBAO);
}
}
示例11: civicrm_api3_membership_type_create
/**
* API to Create or update a Membership Type
*
* @param array $params an associative array of name/value property values of civicrm_membership_type
*
* @return array $result newly created or updated membership type property values.
* @access public
* {getfields MembershipType_get}
*/
function civicrm_api3_membership_type_create($params)
{
$ids['membershipType'] = CRM_Utils_Array::value('id', $params);
$ids['memberOfContact'] = CRM_Utils_Array::value('member_of_contact_id', $params);
$ids['contributionType'] = CRM_Utils_Array::value('financial_type_id', $params);
$membershipTypeBAO = CRM_Member_BAO_MembershipType::add($params, $ids);
$membershipType = array();
_civicrm_api3_object_to_array($membershipTypeBAO, $membershipType[$membershipTypeBAO->id]);
CRM_Member_PseudoConstant::membershipType(NULL, TRUE);
civicrm_api3('membership', 'getfields', array('cache_clear' => 1, 'fieldname' => 'membership_type_id'));
civicrm_api3('profile', 'getfields', array('action' => 'submit', 'cache_clear' => 1));
return civicrm_api3_create_success($membershipType, $params, 'membership_type', 'create', $membershipTypeBAO);
}
示例12: civicrm_api3_event_create
/**
* Create a Event
*
* This API is used for creating a Event
*
* @param array $params input parameters
* Allowed @params array keys are:
* {@getfields event_create}
*
* @return array API result Array.
* @access public
*/
function civicrm_api3_event_create($params)
{
_civicrm_api3_event_create_legacy_support_42($params);
//format custom fields so they can be added
$value = array();
_civicrm_api3_custom_format_params($params, $values, 'Event');
$params = array_merge($values, $params);
require_once 'CRM/Event/BAO/Event.php';
$eventBAO = CRM_Event_BAO_Event::create($params);
$event = array();
_civicrm_api3_object_to_array($eventBAO, $event[$eventBAO->id]);
return civicrm_api3_create_success($event, $params);
}
示例13: civicrm_api3_payment_processor_type_create
/**
* Function to create payment_processor type
*
* @param array $params Associative array of property name/value pairs to insert in new payment_processor type.
*
* @return Newly created PaymentProcessor_type object
* {@getfields PaymentProcessorType_create}
* @access public
* {@schema Core/PaymentProcessorType.xml}
*/
function civicrm_api3_payment_processor_type_create($params)
{
require_once 'CRM/Utils/Rule.php';
$ids = array();
if (isset($params['id']) && !CRM_Utils_Rule::integer($params['id'])) {
return civicrm_api3_create_error('Invalid value for payment_processor type ID');
}
$payProcType = new CRM_Core_BAO_PaymentProcessorType();
$payProcType = CRM_Core_BAO_PaymentProcessorType::create($params);
$relType = array();
_civicrm_api3_object_to_array($payProcType, $relType[$payProcType->id]);
return civicrm_api3_create_success($relType, $params, 'payment_processor_type', 'create', $payProcType);
}
示例14: civicrm_api3_tag_create
/**
* Add a Tag. Tags are used to classify CRM entities (including Contacts, Groups and Actions).
*
* Allowed @params array keys are:
*
* {@example TagCreate.php}
*
* @return array of newly created tag property values.
* {@getfields tag_create}
* @access public
*/
function civicrm_api3_tag_create($params)
{
$ids = array('tag' => CRM_Utils_Array::value('tag', $params));
if (CRM_Utils_Array::value('tag', $params)) {
$ids['tag'] = $params['tag'];
}
if (CRM_Utils_Array::value('id', $params)) {
$ids['tag'] = $params['id'];
}
$tagBAO = CRM_Core_BAO_Tag::add($params, $ids);
$values = array();
_civicrm_api3_object_to_array($tagBAO, $values[$tagBAO->id]);
return civicrm_api3_create_success($values, $params, 'tag', 'create', $tagBAO);
}
示例15: civicrm_api3_membership_type_create
/**
* API to Create or update a Membership Type
*
* @param array $params an associative array of name/value property values of civicrm_membership_type
*
* @return array $result newly created or updated membership type property values.
* @access public
* {getfields MembershipType_get}
*/
function civicrm_api3_membership_type_create($params)
{
$values = $params;
civicrm_api3_verify_mandatory($values, 'CRM_Member_DAO_MembershipType');
$ids['membershipType'] = CRM_Utils_Array::value('id', $values);
$ids['memberOfContact'] = CRM_Utils_Array::value('member_of_contact_id', $values);
$ids['contributionType'] = CRM_Utils_Array::value('contribution_type_id', $values);
require_once 'CRM/Member/BAO/MembershipType.php';
$membershipTypeBAO = CRM_Member_BAO_MembershipType::add($values, $ids);
$membershipType = array();
_civicrm_api3_object_to_array($membershipTypeBAO, $membershipType[$membershipTypeBAO->id]);
CRM_Member_PseudoConstant::membershipType(NULL, TRUE);
return civicrm_api3_create_success($membershipType, $params, 'membership_type', 'create', $membershipTypeBAO);
}