⧼vector-jumptocontent⧽

Int field: Difference between revisions

From EPrints Documentation
Moj (talk | contribs)
No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{fieldtypes}}
{{fieldtypes}}
__NOTOC__
== Inheritance ==


* [[Metadata]]
** [[Int field]]


== Description ==
== 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.


== Properties ==
== Inheritance ==
* [[Metadata]]
** [[Int field]]


== Additional Properties ==
{| border="1" cellpadding="3" cellspacing="0"
{| border="1" cellpadding="3" cellspacing="0"
| name || default || description
! Name !! Default Value !! Required !! Description !! Notes
|-
|-
| '''digits''' || n/a || '''This property is taken from the repository configuration.'''
| '''digits''' || <tt>9</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 reliably store numbers that takes up more than 9 digits (including a sign if negative).
|}
|}


== Required Phrases ==
== Required Phrases ==
 
No additional phrases beyond [[Metadata#Required_Phrases|standard metadata field phrases]].


== Database ==
== Database ==
Int fields are stored in the database as
fieldname INT(11)


Int fields are stored in the database as
== API ==
See [[API:EPrints/MetaField/Int|API page]].


  fieldname INT(11)
== 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,
},

Latest revision as of 17:23, 20 April 2023


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 9 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 reliably store numbers that takes up more than 9 digits (including a sign if negative).

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,
},