Jump to content

API:EPrints/DataObj/SubObject

From EPrints Documentation

Latest Source Code (3.4, 3.3) | Revision Log | Before editing this page please read Pod2Wiki


NAME[edit]

EPrints::DataObj::SubObject - virtual class to support sub-objects

User Comments


DESCRIPTION[edit]

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.

User Comments


CORE METADATA FIELDS[edit]

None.

User Comments


REFERENCES AND RELATED OBJECTS[edit]

None.

User Comments


INSTANCE VARIABLES[edit]

See EPrints::DataObj.

User Comments


METHODS[edit]

User Comments


Constructor Methods[edit]

User Comments


new_from_data[edit]

$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.

User Comments


create_from_data[edit]

$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.

User Comments


Object Methods[edit]

User Comments


get_parent[edit]

$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
 

User Comments


set_parent[edit]

$parent = $dataobj->set_parent( $parent )

Sets _parent attribute to the provide $parent data object.

User Comments


get_parent_dataset_id[edit]

$id = $dataobj->get_parent_dataset_id

Returns the ID of the dataset two which the parent data object belongs.

User Comments


get_parent_id[edit]

$id = $dataobj->get_parent_id

Returns the ID of the parent data object.

User Comments


permit[edit]

$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

User Comments


has_owner[edit]

$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.

User Comments


SEE ALSO[edit]

EPrints::DataObj and EPrints::DataSet.

User Comments


COPYRIGHT[edit]

© Copyright 2000-2024 University of Southampton.

EPrints 3.4 is supplied by EPrints Services.

http://www.eprints.org/eprints-3.4/

LICENSE[edit]

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/.

User Comments