示例#1
0
文件: Date.php 项目: peterzadori/movi
 /**
  * @param $value
  * @param $dataSource
  * @return mixed
  */
 public function filter($value, IDataSource $dataSource)
 {
     $value = strtotime($value);
     $begin = strtotime('today', $value);
     $end = strtotime('+1 day', $begin);
     $dataSource->filter(['%n BETWEEN %s AND %s', $this->column->getColumn(), DateTime::from($begin), DateTime::from($end)]);
 }
示例#2
0
 /**
  * @param $value
  * @param IDataSource $dataSource
  * @return mixed|IDataSource
  */
 public function filter($value, IDataSource $dataSource)
 {
     if (!is_bool($value)) {
         if ($value === 'true') {
             $value = true;
         }
         if ($value === 'false') {
             $value = false;
         }
     }
     $dataSource->filter(['%n = %s', $this->column->getColumn(), $value]);
 }
示例#3
0
 /**
  * @param $value
  * @param $dataSource
  * @return mixed
  */
 public function filter($value, IDataSource $dataSource)
 {
     $dataSource->filter(['LOWER(%n) LIKE %~like~', $this->column->getColumn(), $value]);
 }
示例#4
0
 /**
  * @param $value
  * @param IDataSource $dataSource
  * @return IDataSource
  */
 public function filter($value, IDataSource $dataSource)
 {
     $dataSource->filter(['%n = %i', $this->column->getColumn(), $value]);
 }