Difference between revisions of "API:EPrints/DataObj/SubObject"
Line 30: | Line 30: | ||
<!-- Pod2Wiki=head_core_metadata_fields --> | <!-- Pod2Wiki=head_core_metadata_fields --> | ||
==CORE METADATA FIELDS== | ==CORE METADATA FIELDS== | ||
− | + | None. | |
+ | |||
+ | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
+ | <span style='display:none'>User Comments</span> | ||
+ | <!-- Edit below this comment --> | ||
+ | |||
+ | |||
+ | <!-- Pod2Wiki= --> | ||
+ | </div> | ||
+ | <!-- Pod2Wiki=head_references_and_related_objects --> | ||
+ | ==REFERENCES AND RELATED OBJECTS== | ||
+ | None. | ||
+ | |||
+ | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
+ | <span style='display:none'>User Comments</span> | ||
+ | <!-- Edit below this comment --> | ||
+ | |||
+ | |||
+ | <!-- Pod2Wiki= --> | ||
+ | </div> | ||
+ | <!-- Pod2Wiki=head_instance_variables --> | ||
+ | ==INSTANCE VARIABLES== | ||
+ | See [[API:EPrints/DataObj#INSTANCE_VARIABLES|EPrints::DataObj]]. | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
Line 180: | Line 202: | ||
Returns <tt>true</tt> if parent data object exists and has <tt>$user</tt> as the owner. Otherwise, returns <tt>false</tt>. | Returns <tt>true</tt> if parent data object exists and has <tt>$user</tt> as the owner. Otherwise, returns <tt>false</tt>. | ||
+ | |||
+ | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
+ | <span style='display:none'>User Comments</span> | ||
+ | <!-- Edit below this comment --> | ||
+ | |||
+ | |||
+ | <!-- Pod2Wiki= --> | ||
+ | </div> | ||
+ | <!-- Pod2Wiki=head_see_also --> | ||
+ | ==SEE ALSO== | ||
+ | [[API:EPrints/DataObj|EPrints::DataObj]] and [[API:EPrints/DataSet|EPrints::DataSet]]. | ||
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> |
Latest revision as of 18:44, 10 January 2022
EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects
Latest Source Code (3.4, 3.3) | Revision Log | Before editing this page please read Pod2Wiki
Contents
NAME
EPrints::DataObj::SubObject - virtual class to support sub-objects
DESCRIPTION
This virtual class provides some utility methods to objects that are sub-objects of other data objects.
It expects to find datasetid and objectid fields to identify the parent object.
CORE METADATA FIELDS
None.
REFERENCES AND RELATED OBJECTS
None.
INSTANCE VARIABLES
See EPrints::DataObj.
METHODS
Constructor Methods
new_from_data
$dataobj = EPrints::DataObj::SubObject->new_from_data( $session, $data, [ $dataset ] )
Constructs and returns a new sub-object from the $data provided.
Looks for a special _parent element in $data and uses it to set the parent object, if defined.
$dataset is determined from the class if not provided.
create_from_data
$dataobj = EPrints::DataObj::SubObject->create_from_data( $session, $data, [ $dataset ] )
Creates and returns a new sub-object from the $data provided.
Looks for a special _parent element in $data and uses it to create default values for datasetid and objectid if parent is available and those fields exist on the object.
$dataset is determined from the class if not provided.
Object Methods
get_parent
$parent = $dataobj->get_parent( [ $datasetid, $objectid ] )
Gets and caches the parent data object. If $datasetid and/or $objectid are specified uses these values rather than the stored values.
Subsequent calls to get_parent will return the cached object, regardless of $datasetid and $objectid.
Has alias:
$dataobj->parent
set_parent
$parent = $dataobj->set_parent( $parent )
Sets _parent attribute to the provide $parent data object.
get_parent_dataset_id
$id = $dataobj->get_parent_dataset_id
Returns the ID of the dataset two which the parent data object belongs.
get_parent_id
$id = $dataobj->get_parent_id
Returns the ID of the parent data object.
permit
$r = $dataobj->permit( $priv, [ $user ] )
Checks parent data object for as well as this data object gives permission for $priv. If $user specified then permissions must also be applicable to that user.
Returns true if permitted, otherwise returns false
has_owner
$dataobj->has_owner( $user )
Check whether the $user provided is the owner of this sub-object, which is determined by checking the owner of the parent data object.
Returns true if parent data object exists and has $user as the owner. Otherwise, returns false.
SEE ALSO
EPrints::DataObj and EPrints::DataSet.
COPYRIGHT
© Copyright 2000-2024 University of Southampton.
EPrints 3.4 is supplied by EPrints Services.
http://www.eprints.org/eprints-3.4/
LICENSE
This file is part of EPrints 3.4 http://www.eprints.org/.
EPrints 3.4 and this file are released under the terms of the GNU Lesser General Public License version 3 as published by the Free Software Foundation unless otherwise stated.
EPrints 3.4 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with EPrints 3.4. If not, see http://www.gnu.org/licenses/.