__table = 'civicrm_print_label'; parent::__construct(); } /** * Returns foreign keys and entity references * * @return array * [CRM_Core_Reference_Interface] */ static function getReferenceColumns() { if (!self::$_links) { self::$_links = static ::createReferenceColumns(__CLASS__); self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', '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, 'title' => ts('Print Label ID') , 'required' => true, ) , 'title' => array( 'name' => 'title', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Title') , 'description' => 'User title for for this label layout', 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, ) , 'name' => array( 'name' => 'name', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Name') , 'description' => 'variable name/programmatic handle for this field.', 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, ) , 'description' => array( 'name' => 'description', 'type' => CRM_Utils_Type::T_TEXT, 'title' => ts('Description') , 'description' => 'Description of this label layout', ) , 'label_format_name' => array( 'name' => 'label_format_name', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Label Format') , 'description' => 'This refers to name column of civicrm_option_value row in name_badge option group', 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, 'html' => array( 'type' => 'Select', ) , 'pseudoconstant' => array( 'optionGroupName' => 'name_badge', 'optionEditPath' => 'civicrm/admin/options/name_badge', ) ) , 'label_type_id' => array( 'name' => 'label_type_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Label Type') , 'description' => 'Implicit FK to civicrm_option_value row in NEW label_type option group', 'html' => array( 'type' => 'Select', ) , 'pseudoconstant' => array( 'optionGroupName' => 'label_type', 'optionEditPath' => 'civicrm/admin/options/label_type', ) ) , 'data' => array( 'name' => 'data', 'type' => CRM_Utils_Type::T_LONGTEXT, 'title' => ts('Data') , 'description' => 'contains json encode configurations options', ) , 'is_default' => array( 'name' => 'is_default', 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Label is Default?') , 'description' => 'Is this default?', 'default' => '1', ) , 'is_active' => array( 'name' => 'is_active', 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Label Is Active?') , 'description' => 'Is this option active?', 'default' => '1', ) , 'is_reserved' => array( 'name' => 'is_reserved', 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Is Label Reserved?') , 'description' => 'Is this reserved label?', 'default' => '1', ) , 'created_id' => array( 'name' => 'created_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Label Created By') , 'description' => 'FK to civicrm_contact, who created this label layout', 'FKClassName' => 'CRM_Contact_DAO_Contact', ) , ); } return self::$_fields; } /** * Returns an array containing, for each field, the arary key used for that * field in self::$_fields. * * @return array */ static function &fieldKeys() { if (!(self::$_fieldKeys)) { self::$_fieldKeys = array( 'id' => 'id', 'title' => 'title', 'name' => 'name', 'description' => 'description', 'label_format_name' => 'label_format_name', 'label_type_id' => 'label_type_id', 'data' => 'data', 'is_default' => 'is_default', 'is_active' => 'is_active', 'is_reserved' => 'is_reserved', 'created_id' => 'created_id', ); } return self::$_fieldKeys; } /** * Returns the names of this table * * @return string */ static function getTableName() { return self::$_tableName; } /** * Returns if this table needs to be logged * * @return boolean */ function getLog() { return self::$_log; } /** * Returns the list of fields that can be imported * * @param bool $prefix * * @return array */ static function &import($prefix = false) { $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'print_label', $prefix, array()); return $r; } /** * Returns the list of fields that can be exported * * @param bool $prefix * * @return array */ static function &export($prefix = false) { $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'print_label', $prefix, array()); return $r; } }