some comment fixes
[civicrm-core.git] / CRM / Export / BAO / Export.php
index 1c9e216bb1fb3edf2f93c18eb211cfed9bf07f20..d991ee3b01603b6da9ffa4f287e717a0db2fee45 100644 (file)
@@ -23,7 +23,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
@@ -72,9 +72,8 @@ class CRM_Export_BAO_Export {
    * @param array $exportParams
    * @param string $queryOperator
    *
-   * @static
    */
-  static function exportComponents(
+  public static function exportComponents(
     $selectAll,
     $ids,
     $params,
@@ -323,8 +322,7 @@ class CRM_Export_BAO_Export {
         $componentReturnProperties = CRM_Contact_BAO_Query::defaultReturnProperties($queryMode);
         if ($queryMode == CRM_Contact_BAO_Query::MODE_CONTRIBUTE) {
           // soft credit columns are not automatically populated, because contribution search doesn't require them by default
-          $componentReturnProperties =
-            array_merge(
+          $componentReturnProperties = array_merge(
               $componentReturnProperties,
               CRM_Contribute_BAO_Query::softCreditReturnProperties(TRUE));
         }
@@ -926,7 +924,7 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c
               elseif (is_object($relDAO) && in_array($relationField, array(
                   'email_greeting',
                   'postal_greeting',
-                  'addressee'
+                  'addressee',
                 ))
               ) {
                 //special case for greeting replacement
@@ -1047,7 +1045,7 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c
             elseif (in_array($field, array(
               'email_greeting',
               'postal_greeting',
-              'addressee'
+              'addressee',
             ))) {
               //special case for greeting replacement
               $fldValue = "{$field}_display";
@@ -1200,7 +1198,8 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c
    * @param int $mode
    *   Export mode.
    *
-   * @return string name of the file
+   * @return string
+   *   name of the file
    */
   public static function getExportFileName($output = 'csv', $mode = CRM_Export_Form_Select::CONTACT_EXPORT) {
     switch ($mode) {
@@ -1232,7 +1231,6 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c
 
   /**
    * Handle import error file creation.
-   *
    */
   public static function invoke() {
     $type = CRM_Utils_Request::retrieve('type', 'Positive', CRM_Core_DAO::$_nullObject);
@@ -1250,7 +1248,7 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c
     if ($parserClass[0] == 'CRM' &&
       count($parserClass) >= 3
     ) {
-      require_once(str_replace('_', DIRECTORY_SEPARATOR, $parserName) . ".php");
+      require_once str_replace('_', DIRECTORY_SEPARATOR, $parserName) . ".php";
       // ensure the functions exists
       if (method_exists($parserName, 'errorFileName') &&
         method_exists($parserName, 'saveFileName')
@@ -1279,10 +1277,10 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c
   public static function exportCustom($customSearchClass, $formValues, $order) {
     $ext = CRM_Extension_System::singleton()->getMapper();
     if (!$ext->isExtensionClass($customSearchClass)) {
-      require_once(str_replace('_', DIRECTORY_SEPARATOR, $customSearchClass) . '.php');
+      require_once str_replace('_', DIRECTORY_SEPARATOR, $customSearchClass) . '.php';
     }
     else {
-      require_once($ext->classToPath($customSearchClass));
+      require_once $ext->classToPath($customSearchClass);
     }
     $search = new $customSearchClass($formValues);
 
@@ -1410,7 +1408,7 @@ INSERT INTO {$componentTable} SELECT distinct gc.contact_id FROM civicrm_group_c
         $changeFields = array(
           'groups',
           'tags',
-          'notes'
+          'notes',
         );
 
         if (in_array($fieldName, $changeFields)) {
@@ -1692,11 +1690,10 @@ WHERE  id IN ( $deleteIDString )
    * The function unsets static part of the string, if token is the dynamic part.
    * Example: 'Hello {contact.first_name}' => converted to => '{contact.first_name}'
    * i.e 'Hello Alan' => converted to => 'Alan'
-   *
    */
-  static function _trimNonTokens(
+  public static function _trimNonTokens(
     &$parsedString, $defaultGreeting,
-                                 $addressMergeGreetings, $greetingType = 'postal_greeting'
+    $addressMergeGreetings, $greetingType = 'postal_greeting'
   ) {
     if (!empty($addressMergeGreetings[$greetingType])) {
       $greetingLabel = $addressMergeGreetings[$greetingType];
@@ -1844,7 +1841,7 @@ WHERE  id IN ( $deleteIDString )
       'contact_is_deleted' => 'is_deleted',
       'name' => 'address_name',
       'provider_id' => 'im_service_provider',
-      'phone_type_id' => 'phone_type'
+      'phone_type_id' => 'phone_type',
     );
 
     //figure out which columns are to be replaced by which ones
@@ -1961,7 +1958,6 @@ LIMIT $offset, $limit
 
   /**
    * Manipulate header rows for relationship fields
-   *
    */
   public static function manipulateHeaderRows(&$headerRows, $contactRelationshipTypes) {
     foreach ($headerRows as & $header) {
@@ -1976,7 +1972,6 @@ LIMIT $offset, $limit
   /**
    * Exclude contacts who are deceased, have "Do not mail" privacy setting,
    * or have no street address
-   *
    */
   public static function postalMailingFormat($exportTempTable, &$headerRows, &$sqlColumns, $exportParams) {
     $whereClause = array();
@@ -2043,4 +2038,5 @@ WHERE  {$whereClause}";
     }
     return $componentPaymentFields;
   }
+
 }