is_utf8 = true; } parent::iso2709($data,$type); $this->get_type(); } public function get_type(){ if($this->guide_infos['bl'] == "s" && $this->fields['110']){ $code = substr($this->fields['110'][0]['a'][0],0,1); if($code == "b"){ if($this->fields['410']){ $this->type = "subcollection"; }else{ $this->type = "collection"; } } }elseif($this->fields['200'][0]['f']){ $this->type = "serie"; }else{ $this->type = ""; } } /* * Pour avoir le numéro d'autorité */ public function format_authority_number($authority_number){ global $pmb_import_modele_authorities; //appel à la méthode statique de la classe d'import... if($pmb_import_modele_authorities!= 0){ return call_user_func(array($pmb_import_modele_authorities,"format_authority_number"),$authority_number,20); }else{ return $authority_number; } } public function get_informations($use_rejected = true, $use_associated = true, $use_parallel = false){ $this->use_rejected = $use_rejected; $this->use_associated = $use_associated; $this->use_parallel = $use_parallel; if(!$this->error){ $this->get_common_informations(); $this->get_specifics_informations(); $this->get_rejected_forms(); $this->get_associated_forms(); $this->get_parallel_forms(); } } public function get_common_informations(){ $this->common_data = array(); $this->common_data['authority_number'] = $this->format_authority_number($this->fields['001'][0]['value']); $this->common_data['lang'] = $this->fields[101][0]['a'][0]; $this->common_data['source']=array( 'country' => $this->fields[801][0]['a'][0], 'origin' => $this->fields[801][0]['b'][0], 'date' => $this->fields[801][0]['c'][0] ); } public function get_specifics_informations(){ $this->specifics_data = array(); switch($this->type){ case "collection" : $this->specifics_data = collection::get_informations_from_unimarc($this->fields); break; case "subcollection" : $this->specifics_data = subcollection::get_informations_from_unimarc($this->fields); break; case "serie" : $this->specifics_data = serie::get_informations_from_unimarc($this->fields); break; default : break; } } public function get_rejected_forms(){ //n'existe pas sur ces types d'autorités } public function get_associated_forms(){ $this->associated_forms = array(); } public function get_parallel_forms(){ //non géré dans PMB } public function check_if_exists($data){ switch($data['type_authority']){ case "collection" : $id = collection::check_if_exists($data); break; case "subcollection" : $id = subcollection::check_if_exists($data); break; } return $id; } }