本文整理汇总了PHP中CRM_Contact_BAO_RelationshipType::del方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contact_BAO_RelationshipType::del方法的具体用法?PHP CRM_Contact_BAO_RelationshipType::del怎么用?PHP CRM_Contact_BAO_RelationshipType::del使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Contact_BAO_RelationshipType
的用法示例。
在下文中一共展示了CRM_Contact_BAO_RelationshipType::del方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postProcess
/**
* Function to process the form
*
* @access public
* @return None
*/
function postProcess()
{
if ($this->_action & CRM_CORE_ACTION_DELETE) {
CRM_Contact_BAO_RelationshipType::del($this->_id);
CRM_Core_Session::setStatus(ts('Selected Relationship type has been deleted.'));
} else {
$params = array();
$ids = array();
// store the submitted values in an array
$params = $this->exportValues();
$params['is_active'] = CRM_Utils_Array::value('is_active', $params, false);
if ($this->_action & CRM_CORE_ACTION_UPDATE) {
$ids['relationshipType'] = $this->_id;
}
CRM_Contact_BAO_RelationshipType::add($params, $ids);
CRM_Core_Session::setStatus(ts('The Relationship Type has been saved.'));
}
}
示例2: postProcess
/**
* Function to process the form
*
* @access public
* @return None
*/
public function postProcess()
{
if ($this->_action & CRM_Core_Action::DELETE) {
CRM_Contact_BAO_RelationshipType::del($this->_id);
CRM_Core_Session::setStatus(ts('Selected Relationship type has been deleted.'));
} else {
$params = array();
$ids = array();
// store the submitted values in an array
$params = $this->exportValues();
$params['is_active'] = CRM_Utils_Array::value('is_active', $params, false);
if ($this->_action & CRM_Core_Action::UPDATE) {
$ids['relationshipType'] = $this->_id;
}
$cTypeA = CRM_Utils_System::explode(CRM_Core_DAO::VALUE_SEPARATOR, $params['contact_types_a'], 2);
$cTypeB = CRM_Utils_System::explode(CRM_Core_DAO::VALUE_SEPARATOR, $params['contact_types_b'], 2);
$params['contact_type_a'] = $cTypeA[0];
$params['contact_type_b'] = $cTypeB[0];
$params['contact_sub_type_a'] = $cTypeA[1] ? $cTypeA[1] : 'NULL';
$params['contact_sub_type_b'] = $cTypeB[1] ? $cTypeB[1] : 'NULL';
CRM_Contact_BAO_RelationshipType::add($params, $ids);
CRM_Core_Session::setStatus(ts('The Relationship Type has been saved.'));
}
}
示例3: civicrm_relationship_type_delete
/**
* Delete a relationship type delete
*
* @param id of relationship type $id
*
* @return boolean true if success, else false
* @static void
* @access public
*/
function civicrm_relationship_type_delete(&$params)
{
if (!CRM_Utils_Array::value('id', $params)) {
return civicrm_create_error('Missing required parameter');
}
require_once 'CRM/Utils/Rule.php';
if ($params['id'] != null && !CRM_Utils_Rule::integer($params['id'])) {
return civicrm_create_error('Invalid value for relationship type ID');
}
$relationTypeBAO = new CRM_Contact_BAO_RelationshipType();
return $relationTypeBAO->del($params['id']) ? civicrm_create_success(ts('Deleted relationship type successfully')) : civicrm_create_error(ts('Could not delete relationship type'));
}
示例4: civicrm_api3_relationship_type_delete
/**
* Delete a relationship type delete
*
* @param id of relationship type $id
*
* @return array API Result Array
* {@getfields RelationshipType_delete}
* @static void
* @access public
*/
function civicrm_api3_relationship_type_delete($params)
{
require_once 'CRM/Utils/Rule.php';
if ($params['id'] != NULL && !CRM_Utils_Rule::integer($params['id'])) {
return civicrm_api3_create_error('Invalid value for relationship type ID');
}
$relationTypeBAO = new CRM_Contact_BAO_RelationshipType();
$result = $relationTypeBAO->del($params['id']);
if (!$result) {
return civicrm_api3_create_error('Could not delete relationship type');
}
return civicrm_api3_create_success($result, $params, 'relationship_type', 'delete', $relationTypeBAO);
}