-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GT_DATE GTE_DATE LT_DATE LTE_DATE EQUALS_DATE
- Loading branch information
Mauro Cassani
committed
Oct 17, 2017
1 parent
ed219d1
commit 1774329
Showing
21 changed files
with
293 additions
and
16 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
/** | ||
* This file is part of the ArrayQuery package. | ||
* | ||
* (c) Mauro Cassani<https://github.com/mauretto78> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace ArrayQuery\Filters\Criterion; | ||
|
||
class EqualsDateFilter implements FilterInterface | ||
{ | ||
/** | ||
* @param $value | ||
* @param $valueToCompare | ||
* @return bool | ||
*/ | ||
public function match($value, $valueToCompare, $dateFormat = null) | ||
{ | ||
$valueDate = \DateTimeImmutable::createFromFormat(($dateFormat) ?: 'Y-m-d', $value); | ||
$valueToComapareDate = \DateTimeImmutable::createFromFormat(($dateFormat) ?: 'Y-m-d', $valueToCompare); | ||
|
||
return $valueDate == $valueToComapareDate; | ||
} | ||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
/** | ||
* This file is part of the ArrayQuery package. | ||
* | ||
* (c) Mauro Cassani<https://github.com/mauretto78> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace ArrayQuery\Filters\Criterion; | ||
|
||
class GreaterThanDateFilter implements FilterInterface | ||
{ | ||
/** | ||
* @param $value | ||
* @param $valueToCompare | ||
* @return bool | ||
*/ | ||
public function match($value, $valueToCompare, $dateFormat = null) | ||
{ | ||
$valueDate = \DateTimeImmutable::createFromFormat(($dateFormat) ?: 'Y-m-d', $value); | ||
$valueToComapareDate = \DateTimeImmutable::createFromFormat(($dateFormat) ?: 'Y-m-d', $valueToCompare); | ||
|
||
return $valueDate > $valueToComapareDate; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
/** | ||
* This file is part of the ArrayQuery package. | ||
* | ||
* (c) Mauro Cassani<https://github.com/mauretto78> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace ArrayQuery\Filters\Criterion; | ||
|
||
class GreaterThanEqualsDateFilter implements FilterInterface | ||
{ | ||
/** | ||
* @param $value | ||
* @param $valueToCompare | ||
* @return bool | ||
*/ | ||
public function match($value, $valueToCompare, $dateFormat = null) | ||
{ | ||
$valueDate = \DateTimeImmutable::createFromFormat(($dateFormat) ?: 'Y-m-d', $value); | ||
$valueToComapareDate = \DateTimeImmutable::createFromFormat(($dateFormat) ?: 'Y-m-d', $valueToCompare); | ||
|
||
return $valueDate >= $valueToComapareDate; | ||
} | ||
} |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
/** | ||
* This file is part of the ArrayQuery package. | ||
* | ||
* (c) Mauro Cassani<https://github.com/mauretto78> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace ArrayQuery\Filters\Criterion; | ||
|
||
class LessThanDateFilter implements FilterInterface | ||
{ | ||
/** | ||
* @param $value | ||
* @param $valueToCompare | ||
* @return bool | ||
*/ | ||
public function match($value, $valueToCompare, $dateFormat = null) | ||
{ | ||
$valueDate = \DateTimeImmutable::createFromFormat(($dateFormat) ?: 'Y-m-d', $value); | ||
$valueToComapareDate = \DateTimeImmutable::createFromFormat(($dateFormat) ?: 'Y-m-d', $valueToCompare); | ||
|
||
return $valueDate < $valueToComapareDate; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
/** | ||
* This file is part of the ArrayQuery package. | ||
* | ||
* (c) Mauro Cassani<https://github.com/mauretto78> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace ArrayQuery\Filters\Criterion; | ||
|
||
class LessThanEqualsDateFilter implements FilterInterface | ||
{ | ||
/** | ||
* @param $value | ||
* @param $valueToCompare | ||
* @return bool | ||
*/ | ||
public function match($value, $valueToCompare, $dateFormat = null) | ||
{ | ||
$valueDate = \DateTimeImmutable::createFromFormat(($dateFormat) ?: 'Y-m-d', $value); | ||
$valueToComapareDate = \DateTimeImmutable::createFromFormat(($dateFormat) ?: 'Y-m-d', $valueToCompare); | ||
|
||
return $valueDate <= $valueToComapareDate; | ||
} | ||
} |
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
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
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
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
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
Oops, something went wrong.