Regen DAOs with new import() / export()
[civicrm-core.git] / CRM / Core / DAO / Website.php
index 0aeaffe4675a31b565f1be056454ad8ee7477edf..a99b7580e0c344472f1c5742902dd1ed174a0307 100644 (file)
@@ -59,20 +59,6 @@ class CRM_Core_DAO_Website extends CRM_Core_DAO {
    * @var string
    */
   static $_links = null;
-  /**
-   * static instance to hold the values that can
-   * be imported
-   *
-   * @var array
-   */
-  static $_import = null;
-  /**
-   * static instance to hold the values that can
-   * be exported
-   *
-   * @var array
-   */
-  static $_export = null;
   /**
    * static value to see if we should log any modifications to
    * this table in the civicrm_log table
@@ -222,20 +208,8 @@ class CRM_Core_DAO_Website extends CRM_Core_DAO {
    * @return array
    */
   static function &import($prefix = false) {
-    if (!(self::$_import)) {
-      self::$_import = array();
-      $fields = self::fields();
-      foreach($fields as $name => $field) {
-        if (CRM_Utils_Array::value('import', $field)) {
-          if ($prefix) {
-            self::$_import['website'] = & $fields[$name];
-          } else {
-            self::$_import[$name] = & $fields[$name];
-          }
-        }
-      }
-    }
-    return self::$_import;
+    $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'website', $prefix, array());
+    return $r;
   }
   /**
    * Returns the list of fields that can be exported
@@ -245,19 +219,7 @@ class CRM_Core_DAO_Website extends CRM_Core_DAO {
    * @return array
    */
   static function &export($prefix = false) {
-    if (!(self::$_export)) {
-      self::$_export = array();
-      $fields = self::fields();
-      foreach($fields as $name => $field) {
-        if (CRM_Utils_Array::value('export', $field)) {
-          if ($prefix) {
-            self::$_export['website'] = & $fields[$name];
-          } else {
-            self::$_export[$name] = & $fields[$name];
-          }
-        }
-      }
-    }
-    return self::$_export;
+    $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'website', $prefix, array());
+    return $r;
   }
 }