Created
April 24, 2014 08:24
-
-
Save zviryatko/11246382 to your computer and use it in GitHub Desktop.
Zend framework 2 sql predicate that provide between columns clause.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* Provide sql expression where the value between columns | |
* | |
* @copyright Copyright (c) 2014 HTML&CMS (http://html-and-cms.com) | |
* @license http://framework.zend.com/license/new-bsd New BSD License | |
*/ | |
namespace HTMLandCMS\Db\Sql\Predicate; | |
use Zend\Db\Sql\Predicate\Between; | |
/** | |
* Class BetweenColumns | |
* | |
* @method __construct($value = null, $minIdentifier = null, $maxIdentifier = null) | |
* | |
* @package HTMLandCMS\Db\Sql\Predicate | |
*/ | |
class BetweenColumns extends Between { | |
/** | |
* Return "where" parts | |
* | |
* @return array | |
*/ | |
public function getExpressionData() | |
{ | |
return array( | |
array( | |
$this->getSpecification(), | |
array($this->identifier, $this->minValue, $this->maxValue), | |
array(self::TYPE_VALUE, self::TYPE_IDENTIFIER, self::TYPE_IDENTIFIER), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment