Comment fixes for CRM/Utils directory
[civicrm-core.git] / CRM / Utils / Migrate / Export.php
index dbb1965dcc65281174854003babdb47fae4e3c8a..38d9edb0b3190caf62833ded78b478c0f9a337fd 100644 (file)
@@ -1,9 +1,9 @@
 <?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 {
 
@@ -52,9 +50,6 @@ class CRM_Utils_Migrate_Export {
    */
   protected $_xml;
 
-  /**
-   *
-   */
   public function __construct() {
     $this->_xml = array(
       'customGroup' => array(
@@ -167,9 +162,7 @@ class CRM_Utils_Migrate_Export {
   }
 
   /**
-   * 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
@@ -267,9 +260,10 @@ class CRM_Utils_Migrate_Export {
   }
 
   /**
+   * 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'));
@@ -323,7 +317,6 @@ class CRM_Utils_Migrate_Export {
   /**
    * @param array $ufGroupIds
    *   List of custom groups to export.
-   * @return void
    */
   public function buildUFGroups($ufGroupIds) {
     $ufGroupIdsSql = implode(',', array_filter($ufGroupIds, 'is_numeric'));
@@ -361,7 +354,8 @@ class CRM_Utils_Migrate_Export {
   /**
    * 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" ?>';
@@ -435,7 +429,8 @@ class CRM_Utils_Migrate_Export {
    *   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();
@@ -464,7 +459,7 @@ class CRM_Utils_Migrate_Export {
    * @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();
@@ -476,7 +471,15 @@ class CRM_Utils_Migrate_Export {
       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';
             }
@@ -486,7 +489,7 @@ class CRM_Utils_Migrate_Export {
             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));
@@ -541,7 +544,8 @@ class CRM_Utils_Migrate_Export {
    * @param string $tagName
    * @param array $keyValues
    * @throws Exception
-   * @return string XML
+   * @return string
+   *   XML
    */
   public function renderKeyValueXML($tagName, $keyValues) {
     $xml = "    <$tagName>";
@@ -560,7 +564,8 @@ class CRM_Utils_Migrate_Export {
    * @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)) {
@@ -568,4 +573,5 @@ class CRM_Utils_Migrate_Export {
     }
     return $prefix . "<$name>" . htmlentities($value) . "</$name>";
   }
+
 }