protected function setValuesArray($valuesArray) { parent::setValuesArray($valuesArray); if (isset($valuesArray["object_representations"]) && is_array($valuesArray["object_representations"])) { //read representations and save them into array of Representation $reprsentations = $valuesArray["object_representations"]; foreach ($reprsentations as $key => $value) { $representation = new Representation(array('representation_id' => $key, 'original_filename' => $value['meta_data']['original_filename'], 'mime_type' => $value['meta_data']['mime_type'], 'is_primary' => $value['meta_data']['is_primary'])); foreach ($value['versions'] as $version => $info) { $representation->addVersion($version, $info['url'], $info['info']); } foreach ($value['annotations'] as $annotation) { $representation->addAnnotation($annotation['annotation_id'], $annotation); } $this->addObjectRepresentation($representation); } } }
public function getObjectRepresentationsForObjects($objectIds = array(), $primaryOnly = false, $versions = array()) { $params = array('objectIds' => $objectIds, 'primaryOnly' => $primaryOnly, 'versions' => $versions); $result_arr = $this->call('getObjectRepresentationsForObjects', $params, true, true); $result = array(); foreach ($result_arr as $objectrepresentations) { foreach ($objectrepresentations as $key => $value) { $representation = new Representation(array('representation_id' => $key, 'original_filename' => $value['meta_data']['original_filename'], 'mime_type' => $value['meta_data']['mime_type'], 'is_primary' => $value['meta_data']['is_primary'])); foreach ($value['versions'] as $version => $info) { $representation->addVersion($version, $info['url'], $info['info']); } foreach ($value['annotations'] as $annotation) { $representation->addAnnotation($annotation['annotation_id'], $annotation); } $result[] = $representation; } } return $result; }
/** * Get monograph id * @return int */ function getMonographId() { return parent::getSubmissionId(); }
/** * Constructor. */ function ArticleGalley() { parent::Representation(); }
/** * Constructor. */ function __construct() { parent::__construct(); }
/** * Get request arguments. * @param $row GridRow * @return array */ function getRequestArgs($row) { return array_merge(parent::getRequestArgs($row), array('representationId' => $this->_representation->getId())); }