PatronInfoReader.php 3.38 KB
Newer Older
llaffont's avatar
llaffont committed
1 2 3 4
<?php
/**
 * Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
 *
Laurent's avatar
Laurent committed
5
 * BOKEH is free software; you can redistribute it and/or modify
llaffont's avatar
llaffont committed
6 7 8 9 10 11
 * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
 * the Free Software Foundation.
 *
 * There are special exceptions to the terms and conditions of the AGPL as it
 * is applied to this software (see README file).
 *
Laurent's avatar
Laurent committed
12
 * BOKEH is distributed in the hope that it will be useful,
llaffont's avatar
llaffont committed
13 14 15 16 17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
 *
 * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
Laurent's avatar
Laurent committed
18
 * along with BOKEH; if not, write to the Free Software
llaffont's avatar
llaffont committed
19 20
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA 
 */
21
class Class_WebService_SIGB_Nanook_PatronInfoReader extends Class_WebService_SIGB_AbstractILSDIPatronInfoReader{
llaffont's avatar
llaffont committed
22 23 24 25 26 27 28 29 30 31 32
	/**
	 * @return Class_WebService_SIGB_Nanook_PatronInfoReader
	 */
	public static function newInstance() {
		return new self();
	}

	/**
	 * @param string $data
	 */
	public function endPatronId($data) {
33
		$this->getEmprunteur()->setId($data)->beValid();
llaffont's avatar
llaffont committed
34 35 36
	}


37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
	/**
	 * @param $data string
	 */
	public function endEndDate($data) {
		if ($data && 'null' != $data)
			$this->getEmprunteur()->setEndDate($data);
	}


	/**
	 * @param $data string
	 */
	public function endMail($data) {
		if ($data && 'null' != $data)
			$this->getEmprunteur()->setEmail($data);
	}

54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109

	/** 
	 * @param string $data 
	 */
	public function endBarcode($data) {
		$this->_emprunteur->setCodeBarres($data);
	}


	/** 
	 * @param string $data 
	 */
	public function endAddress($data) {
		$this->_emprunteur->setAdresse($data);
	}


	/** 
	 * @param string $data 
	 */
	public function endTown($data) {
		$this->_emprunteur->setVille($data);
	}


	/** 
	 * @param string $data 
	 */
	public function endZipCode($data) {
		$this->_emprunteur->setCodePostal($data);
	}


	/** 
	 * @param string $data 
	 */
	public function endPhoneNumber($data) {
		$this->_emprunteur->setTelephone($data);
	}


	/** 
	 * @param string $data 
	 */
	public function endDisplayOrder($data) {
		$this->_emprunteur->setOrdre($data);
	}


	/** 
	 * @param string $data 
	 */
	public function endBirthDate($data) {
		$this->_emprunteur->setDateNaissance($data);
	}

110
		
llaffont's avatar
llaffont committed
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
	/**
	 * @param string $data
	 */
	public function endDueDate($data) {
		if ($this->_xml_parser->inParents('loan')) {
			$date = implode('/', array_reverse(explode('-', $data)));
			$this->_currentLoan->getExemplaire()->setDateRetour($date);
		}
	}

	/**
	 * @param string $data
	 */
	public function endItemId($data) {
		$this->_getCurrentOperation()->setId($data);
		$this->_getCurrentOperation()->getExemplaire()->setId($data);
	}


	/**
	 * @param string $data
	 */
	public function endBibId($data) {
		$this->_getCurrentOperation()->getExemplaire()->setNoNotice($data);
	}


	/**
	 * @param string $data
	 */
	public function endLocationLabel($data) {
		$this->_getCurrentOperation()->getExemplaire()->setBibliotheque($data);
	}


146 147 148 149 150 151 152 153 154
	/** 
	 * @param string $data 
	 */
	public function endAvailable($data) {
		if (1 == (int)$data)
			$this->_currentHold->setEtat('Disponible');
	}


155 156 157 158 159 160 161
	/**
	 * @paran string $data
	 */
	public function endAvailabilityDate($data) {
		if ('' != $data)
			$this->_currentHold->setEtat('Pas disponible avant le ' . $data);
	}
llaffont's avatar
llaffont committed
162 163
}
?>