/** * Wrapper for QubitDigitalObject::importFromUri() method * * @param array $uris URIs of remote files * @return QubitInformationObject $this * * @TODO allow for different usage types */ public function importDigitalObjectFromUri($uris) { if (is_array($uris) && 1 < count($uris)) { // Get publication status from current object $pubStatus = null; if (isset($this->statuss) && 0 < count($this->statuss)) { foreach ($this->statuss as $status) { if (QubitTerm::STATUS_TYPE_PUBLICATION_ID == $status->typeId) { $pubStatus = $status->statusId; break; } } } foreach ($uris as $uri) { $infoObject = new QubitInformationObject(); $digitalObject = new QubitDigitalObject(); $digitalObject->usageId = QubitTerm::MASTER_ID; $digitalObject->importFromUri($uri); $infoObject->digitalObjects[] = $digitalObject; $infoObject->title = $digitalObject->name; if (isset($pubStatus)) { $infoObject->setStatus(array('typeId' => QubitTerm::STATUS_TYPE_PUBLICATION_ID, 'statusId' => $pubStatus)); } $this->informationObjectsRelatedByparentId[] = $infoObject; } } else { $digitalObject = new QubitDigitalObject(); $digitalObject->usageId = QubitTerm::MASTER_ID; if (is_array($uris)) { $uris = array_shift($uris); } $digitalObject->importFromUri($uris); $this->digitalObjects[] = $digitalObject; } return $this; }