function &getFields() { if (!self::$_bookingFields) { self::$_bookingFields = array_merge(self::$_bookingFields, CRM_Booking_DAO_Booking::export()); } return self::$_bookingFields; }
/** * Get the exportable fields for Booking * * * @return array array of exportable Fields * @access public * @static */ static function &exportableFields() { if (!isset(self::$_exportableFields["booking"])) { self::$_exportableFields["booking"] = array(); $exportableFields = CRM_Booking_DAO_Booking::export(); $bookingFields = array('booking_title' => array('title' => ts('Title'), 'type' => CRM_Utils_Type::T_STRING), 'booking_po_no' => array('title' => ts('PO Number'), 'type' => CRM_Utils_Type::T_STRING), 'booking_status' => array('title' => ts('Booking Status'), 'type' => CRM_Utils_Type::T_STRING), 'booking_payment_status' => array('title' => ts('Booking Status'), 'type' => CRM_Utils_Type::T_STRING)); $fields = array_merge($bookingFields, $exportableFields); self::$_exportableFields["booking"] = $fields; } return self::$_exportableFields["booking"]; }
/** * returns the list of fields that can be exported * * @access public * return array * @static */ 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['booking'] =& $fields[$name]; } else { self::$_export[$name] =& $fields[$name]; } } } } return self::$_export; }