X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContact%2FBAO%2FRelationshipType.php;h=7515f4f14d5da3b1e0809a69824070e5789fd4a1;hb=1ac9bb56e6130bb7a0c01b9d7c6d1b60fdfcff14;hp=6c44ea5900dcf7638d3d78de5cc38b4dd1721314;hpb=0dbe4aaa486eeccbcd060d5590347bff4b10fa47;p=civicrm-core.git diff --git a/CRM/Contact/BAO/RelationshipType.php b/CRM/Contact/BAO/RelationshipType.php index 6c44ea5900..7515f4f14d 100644 --- a/CRM/Contact/BAO/RelationshipType.php +++ b/CRM/Contact/BAO/RelationshipType.php @@ -85,18 +85,11 @@ class CRM_Contact_BAO_RelationshipType extends CRM_Contact_DAO_RelationshipType } // action is taken depending upon the mode - $relationshipType = new CRM_Contact_DAO_RelationshipType(); - - $hook = empty($params['id']) ? 'create' : 'edit'; - CRM_Utils_Hook::pre($hook, 'RelationshipType', CRM_Utils_Array::value('id', $params), $params); - - $relationshipType->copyValues($params); - $relationshipType->save(); - - CRM_Utils_Hook::post($hook, 'RelationshipType', $relationshipType->id, $relationshipType); + $relationshipType = self::writeRecord($params); CRM_Core_PseudoConstant::relationshipType('label', TRUE); CRM_Core_PseudoConstant::relationshipType('name', TRUE); + CRM_Core_PseudoConstant::flush(); CRM_Case_XMLProcessor::flushStaticCaches(); return $relationshipType; }