-
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
49 additions
and
5 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
21 changes: 21 additions & 0 deletions
21
doctrine/ORM/Query/AST/Platform/Functions/Sqlite/Month.php
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,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Oro\ORM\Query\AST\Platform\Functions\Sqlite; | ||
|
||
use Doctrine\ORM\Query\AST\Node; | ||
use Doctrine\ORM\Query\SqlWalker; | ||
use Oro\ORM\Query\AST\Functions\SimpleFunction; | ||
use Oro\ORM\Query\AST\Platform\Functions\PlatformFunctionNode; | ||
|
||
class Month extends PlatformFunctionNode | ||
{ | ||
public function getSql(SqlWalker $sqlWalker): string | ||
{ | ||
/** @var Node $expression */ | ||
$expression = $this->parameters[SimpleFunction::PARAMETER_KEY]; | ||
|
||
return "STRFTIME('%m', " . $this->getExpressionValue($expression, $sqlWalker) . ")"; | ||
} | ||
} |
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,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Oro\ORM\Query\AST\Platform\Functions\Sqlite; | ||
|
||
use Doctrine\ORM\Query\AST\Node; | ||
use Doctrine\ORM\Query\SqlWalker; | ||
use Oro\ORM\Query\AST\Functions\SimpleFunction; | ||
use Oro\ORM\Query\AST\Platform\Functions\PlatformFunctionNode; | ||
|
||
class Year extends PlatformFunctionNode | ||
{ | ||
public function getSql(SqlWalker $sqlWalker): string | ||
{ | ||
/** @var Node $expression */ | ||
$expression = $this->parameters[SimpleFunction::PARAMETER_KEY]; | ||
|
||
return "STRFTIME('%Y', " . $this->getExpressionValue($expression, $sqlWalker) . ")"; | ||
} | ||
} |
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