\acdhOeaw\utilResourceFactory

Set of helper methods for writing tests.

Summary

Methods
Properties
Constants
init()
createMeta()
create()
removeAcl()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$fedora
N/A

Properties

Methods

init()

init(\acdhOeaw\fedora\Fedora  $fedora) 

Initializes the ResourceFactory class

Parameters

\acdhOeaw\fedora\Fedora $fedora

Fedora connection object

createMeta()

createMeta(array  $properties = array(), boolean  $addId = false, boolean  $addTitle = false) : Resource

Generates metadata from an associative array (keys as properties, values as values).

Parameters

array $properties

array of metadata properties; keys should be fully-qualified URIs with two exceptions - 'title' is automatically mapped to the config:fedoraTitleProp, 'id' to config:fedoraIdProp, 'type' to rdfs:type and 'parent' to config:relProp()

boolean $addId

should an id property be generated if it's not provided in $properties?

boolean $addTitle

should a title property be generated if it's not provided in $properties?

Returns

Resource

create()

create(array  $properties = array(), string  $location = '/', string  $method = 'POST', string  $binary = '') : \acdhOeaw\fedora\FedoraResource

Creates a new resource

Parameters

array $properties

list of RDF properties (key - property, value - property value); 'id', 'title', type' and 'parent' are handled automatically

string $location

where to create the resource

string $method

creation method (POST or PUT)

string $binary

resource content (if empty string, an RDF resource is created)

Returns

\acdhOeaw\fedora\FedoraResource

removeAcl()

removeAcl(\acdhOeaw\fedora\Fedora  $fedora, boolean  $verbose = true) 

Removes all access control rules from the repository

Parameters

\acdhOeaw\fedora\Fedora $fedora

Fedora connection object

boolean $verbose

should progess messages be displayed