Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
afcf6bc1
Commit
afcf6bc1
authored
Dec 25, 2011
by
Kim Hemsø Rasmussen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle conversion of booleans. Added misc date/time methods
parent
341f795f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
DrizzlePlatform.php
lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php
+48
-0
No files found.
lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php
View file @
afcf6bc1
...
...
@@ -52,6 +52,37 @@ class DrizzlePlatform extends AbstractPlatform
return
'`'
;
}
public
function
getConcatExpression
()
{
$args
=
func_get_args
();
return
'CONCAT('
.
join
(
', '
,
(
array
)
$args
)
.
')'
;
}
public
function
getDateDiffExpression
(
$date1
,
$date2
)
{
return
'DATEDIFF('
.
$date1
.
', '
.
$date2
.
')'
;
}
public
function
getDateAddDaysExpression
(
$date
,
$days
)
{
return
'DATE_ADD('
.
$date
.
', INTERVAL '
.
$days
.
' DAY)'
;
}
public
function
getDateSubDaysExpression
(
$date
,
$days
)
{
return
'DATE_SUB('
.
$date
.
', INTERVAL '
.
$days
.
' DAY)'
;
}
public
function
getDateAddMonthExpression
(
$date
,
$months
)
{
return
'DATE_ADD('
.
$date
.
', INTERVAL '
.
$months
.
' MONTH)'
;
}
public
function
getDateSubMonthExpression
(
$date
,
$months
)
{
return
'DATE_SUB('
.
$date
.
', INTERVAL '
.
$months
.
' MONTH)'
;
}
/**
* @override
*/
...
...
@@ -335,4 +366,21 @@ class DrizzlePlatform extends AbstractPlatform
return
'DROP TEMPORARY TABLE '
.
$table
;
}
public
function
convertBooleans
(
$item
)
{
if
(
is_array
(
$item
))
{
foreach
(
$item
as
$key
=>
$value
)
{
if
(
is_bool
(
$value
)
||
is_numeric
(
$item
))
{
$item
[
$key
]
=
(
$value
)
?
'true'
:
'false'
;
}
}
}
else
{
if
(
is_bool
(
$item
)
||
is_numeric
(
$item
))
{
$item
=
(
$item
)
?
'true'
:
'false'
;
}
}
return
$item
;
return
$item
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment