Jump to content

Itemref field

From EPrints Documentation


Description[edit]

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

Inheritance[edit]

Additional Properties[edit]

As for Int fields except for:

Name Default Value Required Description Notes
datasetid n/a YES The ID of the dataset from which an data object (item) is referenced.
get_item undef NO How to get the data object (item) referenced, if it is not just as case of looking up its ID against the value in this field.
render_item undef NO How to render the data object (item) referenced if it is not by using the data object's render_citation_link method.

Required Phrases[edit]

No additional phrases beyond those required for Int fields.

Database[edit]

Itemref fields are stored in the database as

fieldname INT(11)

API[edit]

See API page.

Examples[edit]

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