fields()); foreach ($properties as $name) { if (array_key_exists($name, $params)) { $relationType->$name = $params[$name]; } } } $relationType->find(); while ($relationType->fetch()) { _civicrm_object_to_array(clone($relationType), $relationshipType); $relationshipTypes[] = $relationshipType; } return $relationshipTypes; } /** * 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')); } /** * Wrapper to support rest calls, CRM-6860 * return An array of Relationship_type * * @access public */ function civicrm_relationshipType_get($params = NULL) { return civicrm_relationship_types_get($params); }