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
060739d7
Commit
060739d7
authored
Sep 15, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added Regexp operator compatibility for mysql and pgsql drivers
parent
eacb7814
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
4 deletions
+33
-4
Connection.php
Doctrine/Connection.php
+9
-0
Mysql.php
Doctrine/Connection/Mysql.php
+10
-0
Pgsql.php
Doctrine/Connection/Pgsql.php
+9
-0
Where.php
Doctrine/Query/Where.php
+5
-4
No files found.
Doctrine/Connection.php
View file @
060739d7
...
@@ -126,6 +126,15 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
...
@@ -126,6 +126,15 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
public
function
getDBH
()
{
public
function
getDBH
()
{
return
$this
->
dbh
;
return
$this
->
dbh
;
}
}
/**
* returns the regular expression operator
* (implemented by the connection drivers)
*
* @return string
*/
public
function
getRegexpOperator
()
{
throw
new
Doctrine_Connection_Exception
(
'Regular expression operator is not supported by this database driver.'
);
}
/**
/**
* query
* query
* queries the database with Doctrine Query Language
* queries the database with Doctrine Query Language
...
...
Doctrine/Connection/Mysql.php
View file @
060739d7
...
@@ -14,10 +14,20 @@ class Doctrine_Connection_Mysql extends Doctrine_Connection_Common {
...
@@ -14,10 +14,20 @@ class Doctrine_Connection_Mysql extends Doctrine_Connection_Common {
$this
->
setAttribute
(
Doctrine
::
ATTR_QUERY_LIMIT
,
Doctrine
::
LIMIT_ROWS
);
$this
->
setAttribute
(
Doctrine
::
ATTR_QUERY_LIMIT
,
Doctrine
::
LIMIT_ROWS
);
parent
::
__construct
(
$manager
,
$pdo
);
parent
::
__construct
(
$manager
,
$pdo
);
}
}
/**
* returns the regular expression operator
* (implemented by the connection drivers)
*
* @return string
*/
public
function
getRegexpOperator
()
{
return
'RLIKE'
;
}
/**
/**
* deletes all data access object from the collection
* deletes all data access object from the collection
* @param Doctrine_Collection $coll
* @param Doctrine_Collection $coll
*/
*/
/**
/**
public function deleteCollection(Doctrine_Collection $coll) {
public function deleteCollection(Doctrine_Collection $coll) {
...
...
Doctrine/Connection/Pgsql.php
View file @
060739d7
...
@@ -14,5 +14,14 @@ class Doctrine_Connection_Pgsql extends Doctrine_Connection_Common {
...
@@ -14,5 +14,14 @@ class Doctrine_Connection_Pgsql extends Doctrine_Connection_Common {
$data
=
$stmt
->
fetch
(
PDO
::
FETCH_NUM
);
$data
=
$stmt
->
fetch
(
PDO
::
FETCH_NUM
);
return
$data
[
0
];
return
$data
[
0
];
}
}
/**
* returns the regular expression operator
* (implemented by the connection drivers)
*
* @return string
*/
public
function
getRegexpOperator
()
{
return
'SIMILAR TO'
;
}
}
}
Doctrine/Query/Where.php
View file @
060739d7
...
@@ -48,10 +48,11 @@ class Doctrine_Query_Where extends Doctrine_Query_Condition {
...
@@ -48,10 +48,11 @@ class Doctrine_Query_Where extends Doctrine_Query_Condition {
$stack
=
$this
->
query
->
getTableStack
();
$stack
=
$this
->
query
->
getTableStack
();
switch
(
$func
)
{
switch
(
$func
)
{
case
'contains'
:
case
'contains'
:
$operator
=
' = '
;
case
'similarTo'
:
case
'regexp'
:
case
'isLike'
:
$operator
=
' RLIKE '
;
case
'like'
:
if
(
empty
(
$relation
))
if
(
empty
(
$relation
))
throw
new
Doctrine_Query_Exception
(
'DQL function contains can only be used for fields of related components'
);
throw
new
Doctrine_Query_Exception
(
'DQL function contains can only be used for fields of related components'
);
...
...
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