Difference between revisions of "Int field"

From EPrints Documentation
Jump to: navigation, search
(Additional Properties)
(Additional Properties)
Line 13: Line 13:
 
! Name !! Default Value !! Required !! Description !! Notes
 
! Name !! Default Value !! Required !! Description !! Notes
 
|-
 
|-
| '''digits''' || <tt>20</tt> || NO || The maximum number of digits for the integer value. || The default value for this property is taken from <tt>cfg.d/field_property_defaults.pl</tt>.  Analogous to <tt>maxlength</tt>.  Database <tt>INT(11)</tt> cannot store number that takes up more than 11 digits including sign.
+
| '''digits''' || <tt>11</tt> || NO || The maximum number of digits for the integer value. || The default value for this property is taken from <tt>cfg.d/field_property_defaults.pl</tt>.  Analogous to <tt>maxlength</tt>.  Database <tt>INT(11)</tt> cannot store number that takes up more than 11 digits including sign.
 
|}
 
|}
  

Revision as of 14:29, 16 April 2023

EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects


Metadata Fields: Arclanguage - Base64 - Bigint - Boolean - Compound - Counter - Dataobjref - Date - Decimal - Email - Fields - Float - Id - Idci - Image - Int - Itemref - Keywords - Langid - Longtext - Longtext_counter - Multilang - Multipart - Name - Namedset - Pagerange - Recaptcha - Relation - Search - Secret - Set - Storable - Subject - Subobject - Text - Time - Timestamp - Url - Uuid


Description

This metadata field is for store whole number values. Such as the number of pages of a publication or number of pieces that make up an exhibition-type publication. Maximum number that can be stored is 2,147,483,647, minimum number is -2,147,483,647.

Inheritance

Additional Properties

Name Default Value Required Description Notes
digits 11 NO The maximum number of digits for the integer value. The default value for this property is taken from cfg.d/field_property_defaults.pl. Analogous to maxlength. Database INT(11) cannot store number that takes up more than 11 digits including sign.

Required Phrases

No additional phrases beyond standard metadata field phrases.

Database

Int fields are stored in the database as

fieldname INT(11)

API

See API page.

Examples

Most basic example.

{
    name => 'num_pieces',
    type => 'int',
},

Limit input field to six characters (digits) and do not create a SQL database table index.

{
    name => 'pages',
    type => 'int',
    maxlength => 6,
    sql_index => 0,
},