⧼vector-jumptocontent⧽

Itemref field: Difference between revisions

From EPrints Documentation
Moj (talk | contribs)
No edit summary
Added consistent structure
Line 1: Line 1:
{{fieldtypes}}
{{fieldtypes}}
__NOTOC__
 
 
== Description ==
This field allows another data object to be referenced, which belongs to a specified datasetid.
 
== Inheritance ==
== Inheritance ==
* [[Metadata]]
* [[Metadata]]
** [[Int field]]
** [[Int field]]
*** [[Itemref field]]
*** [[Itemref field]]
== Description ==


== Properties ==
== Properties ==
 
As for [[Int field]]s with the following differences...
As for [[int field]]s with the following differences...


{| border="1" cellpadding="3" cellspacing="0"
{| border="1" cellpadding="3" cellspacing="0"
Line 20: Line 20:


== Required Phrases ==
== Required Phrases ==
No additional phrases.
== Database ==
Int fields are stored in the database as
fieldname INT(11)
== API ==
See [[API:EPrints/MetaField/Itemref|API page]].
== Examples ==
Most basic example.
{
    name => 'userid',
    type => 'itemref',
    datasetid => 'user',
},
To specify one eprint succeeds another.  This may not always be required and if you clone the eprint record the new eprint should not succeed the same eprint.
{
    name => 'succeeds',
    type => 'itemref',
    required => 0,
    datasetid => 'eprint',
    can_clone => 0,
}
You might create a data object that groups together several eprints
{
    name => 'items',
    type => 'itemref',
    datasetid => 'eprint',
    multiple => 1,
    required => 1,
}

Revision as of 10:47, 23 March 2023


Description

This field allows another data object to be referenced, which belongs to a specified datasetid.

Inheritance

Properties

As for Int fields with the following differences...

name default description
datasetid n/a This property is always required.

Required Phrases

No additional phrases.

Database

Int fields are stored in the database as

fieldname INT(11)

API

See API page.

Examples

Most basic example.

{
    name => 'userid',
    type => 'itemref',
    datasetid => 'user',
},

To specify one eprint succeeds another. This may not always be required and if you clone the eprint record the new eprint should not succeed the same eprint.

{
    name => 'succeeds', 
    type => 'itemref',
    required => 0,
    datasetid => 'eprint', 
    can_clone => 0,
}

You might create a data object that groups together several eprints

{
    name => 'items',
    type => 'itemref', 
    datasetid => 'eprint', 
    multiple => 1, 
    required => 1,
}