/** * Load data from source array * * @param array $arr */ public function load($arr) { $this->vars = $arr; // keep for use later $this->target_id = $arr['pz2_key']; foreach ($arr as $k => $v) { $this->pz2_key = $arr['pz2_key']; } $this->library_id = $arr['library_id']; $this->name = $arr['full_name']; $this->description = isset($arr['description']) ? $arr['description'] : ''; $this->type = isset($arr['type']) ? $arr['type'] : ''; $this->web['opac_url'] = isset($arr['opac_url']) ? $arr['opac_url'] : ''; $this->web['information_url'] = isset($arr['visitor_information_url']) ? $arr['visitor_information_url'] : ''; if ($this->type != 'virtual') { $this->address['address'] = isset($arr['address']) ? $arr['address'] : ''; $this->address['postcode'] = isset($arr['postcode']) ? $arr['address'] : ''; $this->contact['phone'] = isset($arr['phone']) ? $arr['phone'] : ''; $this->contact['email'] = isset($arr['email']) ? $arr['email'] : ''; $this->location['district'] = isset($arr['district']) ? $arr['district'] : ''; $this->location['longitude'] = isset($arr['longitude']) ? $arr['longitude'] : ''; $this->location['latitude'] = isset($arr['latitude']) ? $arr['latitude'] : ''; $this->location['northing'] = isset($arr['northing']) ? $arr['northing'] : ''; $this->location['easting'] = isset($arr['easting']) ? $arr['easting'] : ''; } $subjects = new Subjects(); $this->subjects = $subjects->getSubjectsByLibrary($this->pz2_key, $this->library_id); parent::load($arr); }
public function subjectoptionsAction() { // fetch all the target data for xsl lookups $uo = new UserOptions($this->request); $type = $uo->getSessionData('source_type'); $pzt = new Targets($type); $this->data->setVariable('all-targets', $pzt->toArray()); $pzt = new Affiliations(); $this->data->setVariable('all-institutions', $pzt->getAllInstitutions()); // we need all subject data for lookups $s = new Subjects(); $this->data->setVariable('all-subjects', $s->getSubjects()); // fetch the selected data $this->data->setVariable('useroptions', $uo); return $this->data; }