3 /* +-----------------------------------------------------------------------------+
4 * Copyright 2016 matrix israel
5 * LICENSE: This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 3
8 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see
15 * http://www.gnu.org/licenses/licenses.html#GPL
16 * @author Oshri Rozmarin <oshri.rozmarin@gmail.com>
17 * +------------------------------------------------------------------------------+
21 namespace Multipledb\Model
;
22 use Zend\InputFilter\InputFilter
;
23 use Zend\InputFilter\InputFilterAwareInterface
;
24 use Zend\InputFilter\InputFilterInterface
;
27 class Multipledb
implements InputFilterAwareInterface
30 const FIELD_ID
= "id";
40 public function exchangeArray($data)
43 $this->id
= (!empty($data['id'])) ?
$data['id'] : null;
44 $this->namespace = (!empty($data['namespace'])) ?
$data['namespace'] : null;
45 $this->username
= (!empty($data['username'])) ?
$data['username'] : null;
46 $this->password
= (!empty($data['password'])) ?
$data['password'] : null;
47 $this->dbname
= (!empty($data['dbname'])) ?
$data['dbname'] : null;
48 $this->host
= (!empty($data['host'])) ?
$data['host'] : null;
49 $this->port
= (!empty($data['port'])) ?
$data['port'] : null;
50 $this->date
= (!empty($data['date'])) ?
$data['date'] : null;
58 public static $inputsValidations = array(
63 array('name' => 'Int'),
67 'name' => 'namespace',
92 array('name' => 'Int'),
99 public function setInputFilter(InputFilterInterface
$inputFilter)
101 throw new \
Exception("Not used");
104 public function getInputFilter()
106 if (!$this->inputFilter
) {
107 $inputFilter = new InputFilter();
109 foreach(self
::$inputsValidations as $input) {
110 $inputFilter->add($input);
113 $this->inputFilter
= $inputFilter;
115 return $this->inputFilter
;