$debug
$debug : boolean
Debug mode switch.
Description of File
$fedora : \acdhOeaw\fedora\Fedora
Fedora connection object.
$res : \acdhOeaw\fedora\FedoraResource
Repository resource representing given entity.
__construct(\acdhOeaw\fedora\Fedora $fedora, \acdhOeaw\schema\file\type $id, string $class = null, string $parent = null)
Creates an object representing a file (or a directory) in a filesystem.
\acdhOeaw\fedora\Fedora | $fedora | repository connection object |
\acdhOeaw\schema\file\type | $id | file path |
string | $class | RDF class to be used as a repository resource type |
string | $parent | URI of a repository resource being parent of created one |
getResource(boolean $create = true, boolean $uploadBinary = true) : \acdhOeaw\fedora\FedoraResource
Returns repository resource representing given real-world entity.
If it does not exist, it can be created.
boolean | $create | should repository resource be created if it does not exist? |
boolean | $uploadBinary | should binary data of the real-world entity be uploaded uppon repository resource creation? |
updateRms(boolean $create = true, boolean $uploadBinary = true, string $path = '/') : \acdhOeaw\fedora\FedoraResource
Updates repository resource representing a real-world entity stored in this object.
boolean | $create | should repository resource be created if it does not exist? |
boolean | $uploadBinary | should binary data of the real-world entity be uploaded uppon repository resource creation? |
string | $path | where to create a resource (if it does not exist). If it it ends with a "/", the resource will be created as a child of a given collection). All the parents in the Fedora resource tree have to exist (you can not create "/foo/bar" if "/foo" does not exist already). |
getCreated() : boolean
Informs about the corresponding repository resource state uppon last call to the `updateRms()` method: - null - the updateRms() was not called yet - true - repository resource was created by last call to the updateRms() - false - repository resource already existed uppoin last call to the updateRms()
setMetadata(Resource $meta, array $preserve = array())
Sets an external metadata to be appended to automatically generated ones.
If a given metatada property exists both in automatically generated and provided metadata, then the final result depends on the $preserve parameter:
Resource | $meta | external metadata |
array | $preserve | list of metadata properties to be kept - see above |
createNewVersion(boolean $uploadBinary = true, string $path = '/', boolean $pidPass = false) : \acdhOeaw\fedora\FedoraResource
Creates a new version of the resource. The new version inherits all IDs but the UUID and epic PIDs. The old version looses all IDs but the UUID and spic PIDs. It also looses all RC::relProp() connections with collections.
The old and the new resource are linked with cfg:fedoraIsNewVersionProp
and cfg:fedoraIsOldVersionProp
.
boolean | $uploadBinary | should binary data of the real-world entity be uploaded uppon repository resource creation? |
string | $path | where to create a resource (if it does not exist). If it it ends with a "/", the resource will be created as a child of a given collection). All the parents in the Fedora resource tree have to exist (you can not create "/foo/bar" if "/foo" does not exist already). |
boolean | $pidPass | should PIDs (epic handles) be migrated to the new
version ( |
old version resource
setMetaLookup(\acdhOeaw\util\metaLookup\MetaLookupInterface $metaLookup, boolean $require = false)
Sets a metadata lookup object to be used for searching for file's metadata which can not be automatically derived from the file itself.
Metadata found using metadata lookup have precedense over metadata automatically derived from the file.
\acdhOeaw\util\metaLookup\MetaLookupInterface | $metaLookup | metadata lookup object |
boolean | $require | should metadata operations fail when no external metadata can be found |
findResource(boolean $create = true, boolean $uploadBinary = true, string $path = '') : boolean
Tries to find a repository resource representing a given object.
boolean | $create | should repository resource be created if it was not found? |
boolean | $uploadBinary | should binary data of the real-world entity be uploaded uppon repository resource creation? |
string | $path | where to create a resource (if it does not exist). If it it ends with a "/", the resource will be created as a child of a given collection). All the parents in the Fedora resource tree have to exist (you can not create "/foo/bar" if "/foo" does not exist already). |
if a repository resource was found
mergeMetadata(Resource $current, Resource $new) : Resource
Merges metadata coming from the Fedora and generated by the class.
Preserves the resource title if it already exists.
Resource | $current | current Fedora resource metadata |
Resource | $new | metadata generated by the class |
final metadata