Merge pull request #4948 from pratikshad/code-cleanup
[civicrm-core.git] / api / v3 / RelationshipType.php
index 8c2f6bad5db664b0c362879ca783ed1f6cad2f2b..d7b1eb516e6a39710fefa87bcc9463644e8e4136 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  */
 
 /**
- * Function to create relationship type
+ * create relationship type
  *
- * @param  array $params   Associative array of property name/value pairs to insert in new relationship type.
+ * @param array $params
+ *   Associative array of property name/value pairs to insert in new relationship type.
  *
- * @return Newly created Relationship_type object
- * {@getfields RelationshipType_create}
- * @access public
- * {@schema Contact/RelationshipType.xml}
+ * @return array
  */
 function civicrm_api3_relationship_type_create($params) {
 
@@ -66,7 +64,6 @@ function civicrm_api3_relationship_type_create($params) {
     $ids['relationshipType'] = CRM_Utils_Array::value('id', $params);
   }
 
-  $relationType = new CRM_Contact_BAO_RelationshipType();
   $relationType = CRM_Contact_BAO_RelationshipType::add($params, $ids);
 
   $relType = array();
@@ -80,7 +77,8 @@ function civicrm_api3_relationship_type_create($params) {
  * Adjust Metadata for Create action
  *
  * The metadata is used for setting defaults, documentation & validation
- * @param array $params array or parameters determined by getfields
+ * @param array $params
+ *   Array or parameters determined by getfields.
  */
 function _civicrm_api3_relationship_type_create_spec(&$params) {
   $params['contact_type_a']['api.required'] = 1;
@@ -91,11 +89,13 @@ function _civicrm_api3_relationship_type_create_spec(&$params) {
 }
 
 /**
- * Function to get all relationship type
+ * get all relationship type
  * retruns  An array of Relationship_type
  * @access  public
  * {@getfields RelationshipType_get}
  * @example RelationshipTypeGet.php
+ * @param array $params
+ * @return array
  */
 function civicrm_api3_relationship_type_get($params) {
   return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
@@ -104,14 +104,11 @@ function civicrm_api3_relationship_type_get($params) {
 /**
  * Delete a relationship type delete
  *
- * @param  id of relationship type  $id
+ * @param array $params
  *
- * @return array API Result Array
- * {@getfields RelationshipType_delete}
- * @static void
- * @access public
+ * @return array
+ *   API Result Array
  */
 function civicrm_api3_relationship_type_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }
-