Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Db / Sql / Predicate / Between.php
blob4516c9e2cde5f4152fc8001f101ca12dbeda1960
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\Db\Sql\Predicate;
12 class Between implements PredicateInterface
14 protected $specification = '%1$s BETWEEN %2$s AND %3$s';
15 protected $identifier = null;
16 protected $minValue = null;
17 protected $maxValue = null;
19 /**
20 * Constructor
22 * @param string $identifier
23 * @param int|float|string $minValue
24 * @param int|float|string $maxValue
26 public function __construct($identifier = null, $minValue = null, $maxValue = null)
28 if ($identifier) {
29 $this->setIdentifier($identifier);
31 if ($minValue !== null) {
32 $this->setMinValue($minValue);
34 if ($maxValue !== null) {
35 $this->setMaxValue($maxValue);
39 /**
40 * Set identifier for comparison
42 * @param string $identifier
43 * @return Between
45 public function setIdentifier($identifier)
47 $this->identifier = $identifier;
48 return $this;
51 /**
52 * Get identifier of comparison
54 * @return null|string
56 public function getIdentifier()
58 return $this->identifier;
61 /**
62 * Set minimum boundary for comparison
64 * @param int|float|string $minValue
65 * @return Between
67 public function setMinValue($minValue)
69 $this->minValue = $minValue;
70 return $this;
73 /**
74 * Get minimum boundary for comparison
76 * @return null|int|float|string
78 public function getMinValue()
80 return $this->minValue;
83 /**
84 * Set maximum boundary for comparison
86 * @param int|float|string $maxValue
87 * @return Between
89 public function setMaxValue($maxValue)
91 $this->maxValue = $maxValue;
92 return $this;
95 /**
96 * Get maximum boundary for comparison
98 * @return null|int|float|string
100 public function getMaxValue()
102 return $this->maxValue;
106 * Set specification string to use in forming SQL predicate
108 * @param string $specification
109 * @return Between
111 public function setSpecification($specification)
113 $this->specification = $specification;
114 return $this;
118 * Get specification string to use in forming SQL predicate
120 * @return string
122 public function getSpecification()
124 return $this->specification;
128 * Return "where" parts
130 * @return array
132 public function getExpressionData()
134 return array(
135 array(
136 $this->getSpecification(),
137 array($this->identifier, $this->minValue, $this->maxValue),
138 array(self::TYPE_IDENTIFIER, self::TYPE_VALUE, self::TYPE_VALUE),