The EIController class handles all correspondence between the model and the view architectures.
The EIController class implements the Singleton design pattern.
Methods
Empties the queue.
clearQueue()
Retrieves an error, if any, for a given nid.
getError($nid) : bool
Parameters
$nid
Returns
bool
Returns the single instance of the EIController class.
getInstance() : \EIController | null
Static
Retrieves the version of the current ontology on the Eagle-I node.
getOntologyVersion() : mixed
Retrieves a clone of the current Queue.
getQueue() : mixed
Retrieves the size of the current Queue.
getQueueSize() : int
Formulate a suitable message for the user from an activity id.
getUserMessage($aid) : array
More specifically a message ready for drupal_set_message.
Parameters
Returns
array
- an array in the form (message, status)
Maps a node to an EIExchangeInstance and pushes it to the Eagle-I node api,
returning the result of the API exchange.
processNode($node, $batch) : bool | null
Parameters
$node
- either the node object, or the nid to process
$batch
Exceptions
\Exception |
- if the Eagle-I ontology on the Drupal site doesn't match that on the node. |
Returns
bool
null
- the activity id of the logged activity or null if no activity was logged
Process the passed number of nids in the queue, or all nids if no
number is passed.
processQueue(null $num)
Add the passed nids to the Queue.
queueNodes($nids)
The nids may be an array, or
a single scaler int.
Parameters
$nids
Provides a testing interface for the EIDataConnector object
testDataConnector($type, bool $uri) : string
Parameters
$type
$uri
bool
Returns
string
Provides a testing interface for the EIDataMapper object
testDataMapper($nid) : string
Parameters
$nid
Returns
string
__construct()
__construct()
Remove all errors from the errors table for a given nid.
cleanErrors($nid)
Retrieve whether Drupal has the same ontology version as the Eagle-I node or not.
hasCurrentOntology() : bool
Log activity in the activity table.
logActivity($nid, $eid, null $exchangeInstance, null $instanceUpdateRequest) : bool | null
Parameters
$nid
$eid
$exchangeInstance
null
$instanceUpdateRequest
null
Returns
bool
null
Log an error in the errors table.
logError($ex) : int | null
Parameters
$ex
- The exception object caught.
Returns
int
null
Updates the stored uris with those received from the Eagle-I node.
updateNodeUris($instanceUpdateRequest)
Parameters
$instanceUpdateRequest
Write a record to the eagle_i_uris table for the given data.
writeUriRecord($data, $update)
Parameters
$data
An array containing the nid and the uri
$update
Pass true if updating the table
Properties