__table = 'civicrm_line_item'; parent::__construct(); } /** * Return foreign links. * * @return array */ public function links() { if (!(self::$_links)) { self::$_links = array( 'price_field_id' => 'civicrm_price_field:id', 'price_field_value_id' => 'civicrm_price_field_value:id', ); } return self::$_links; } /** * Returns all the column names of this table. * * @return array */ static function &fields() { if (!(self::$_fields)) { self::$_fields = array( 'id' => array( 'name' => 'id', 'type' => CRM_Utils_Type::T_INT, 'required' => TRUE, ), 'entity_table' => array( 'name' => 'entity_table', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Entity Table'), 'required' => TRUE, 'maxlength' => 64, 'size' => CRM_Utils_Type::BIG, ), 'entity_id' => array( 'name' => 'entity_id', 'type' => CRM_Utils_Type::T_INT, 'required' => TRUE, ), 'price_field_id' => array( 'name' => 'price_field_id', 'type' => CRM_Utils_Type::T_INT, 'required' => TRUE, 'FKClassName' => 'Snapshot_v4p2_Price_DAO_Field', ), 'label' => array( 'name' => 'label', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Label'), 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, 'default' => 'UL', ), 'qty' => array( 'name' => 'qty', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Qty'), 'required' => TRUE, ), 'unit_price' => array( 'name' => 'unit_price', 'type' => CRM_Utils_Type::T_MONEY, 'title' => ts('Unit Price'), 'required' => TRUE, ), 'line_total' => array( 'name' => 'line_total', 'type' => CRM_Utils_Type::T_MONEY, 'title' => ts('Line Total'), 'required' => TRUE, ), 'participant_count' => array( 'name' => 'participant_count', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Participant Count'), 'default' => 'UL', ), 'price_field_value_id' => array( 'name' => 'price_field_value_id', 'type' => CRM_Utils_Type::T_INT, 'default' => 'UL', 'FKClassName' => 'Snapshot_v4p2_Price_DAO_FieldValue', ), ); } return self::$_fields; } /** * returns the names of this table. * * @return string */ public static function getTableName() { return self::$_tableName; } /** * returns if this table needs to be logged. * * @return boolean */ public function getLog() { return self::$_log; } /** * returns the list of fields that can be imported. * * @return array */ static function &import($prefix = FALSE) { if (!(self::$_import)) { self::$_import = array(); $fields = self::fields(); foreach ($fields as $name => $field) { if (!empty($field['import'])) { if ($prefix) { self::$_import['line_item'] = &$fields[$name]; } else { self::$_import[$name] = &$fields[$name]; } } } } return self::$_import; } /** * returns the list of fields that can be exported. * * @return array */ static function &export($prefix = FALSE) { if (!(self::$_export)) { self::$_export = array(); $fields = self::fields(); foreach ($fields as $name => $field) { if (!empty($field['export'])) { if ($prefix) { self::$_export['line_item'] = &$fields[$name]; } else { self::$_export[$name] = &$fields[$name]; } } } } return self::$_export; } }