<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.6 |
+ | CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
- * $Id$
- *
+ * @copyright CiviCRM LLC (c) 2004-2015
*/
class CRM_Utils_Migrate_Export {
*/
protected $_xml;
- /**
- *
- */
public function __construct() {
$this->_xml = array(
'customGroup' => array(
}
/**
- * Scan local customizations and build an in-memory representation
- *
- * @return void
+ * Scan local customizations and build an in-memory representation.
*/
public function build() {
// fetch the option group / values for
}
/**
+ * Build custom groups.
+ *
* @param array $customGroupIds
* List of custom groups to export.
- * @return void
*/
public function buildCustomGroups($customGroupIds) {
$customGroupIdsSql = implode(',', array_filter($customGroupIds, 'is_numeric'));
/**
* @param array $ufGroupIds
* List of custom groups to export.
- * @return void
*/
public function buildUFGroups($ufGroupIds) {
$ufGroupIdsSql = implode(',', array_filter($ufGroupIds, 'is_numeric'));
/**
* Render the in-memory representation as XML
*
- * @return string XML
+ * @return string
+ * XML
*/
public function toXML() {
$buffer = '<?xml version="1.0" encoding="iso-8859-1" ?>';
* Each item is an array(0 => MappedEntityname, 1 => InputFieldName (id-field), 2 => OutputFieldName (name-field), 3 => OptionalPrefix).
* @param CRM_Core_DAO $dao
* The entity for which we want to prepare mapped fields.
- * @return array new fields
+ * @return array
+ * new fields
*/
public function computeMappedFields($mappedFields, $dao) {
$keyValues = array();
* @return array
*/
public function exportDAO($objectName, $object, $mappedFields) {
- $dbFields = & $object->fields();
+ $dbFields = &$object->fields();
// Filter the list of keys and values so that we only export interesting stuff
$keyValues = array();
if (isset($object->$name) && $object->$name !== NULL) {
// hack for extends_entity_column_value
if ($name == 'extends_entity_column_value') {
- if (in_array($object->extends, array('Event', 'Activity', 'Relationship', 'Individual', 'Organization', 'Household', 'Case'))) {
+ if (in_array($object->extends, array(
+ 'Event',
+ 'Activity',
+ 'Relationship',
+ 'Individual',
+ 'Organization',
+ 'Household',
+ 'Case',
+ ))) {
if ($object->extends == 'Event') {
$key = 'event_type';
}
elseif ($object->extends == 'Relationship') {
$key = 'relationship_type';
}
- elseif($object->extends == 'Case') {
+ elseif ($object->extends == 'Case') {
$key = 'case_type';
}
$types = explode(CRM_Core_DAO::VALUE_SEPARATOR, substr($object->$name, 1, -1));
* @param string $tagName
* @param array $keyValues
* @throws Exception
- * @return string XML
+ * @return string
+ * XML
*/
public function renderKeyValueXML($tagName, $keyValues) {
$xml = " <$tagName>";
* @param string $prefix
*
* @throws Exception
- * @return string XML
+ * @return string
+ * XML
*/
public function renderTextTag($name, $value, $prefix = '') {
if (!preg_match('/^[a-zA-Z0-9\_]+$/', $name)) {
}
return $prefix . "<$name>" . htmlentities($value) . "</$name>";
}
+
}