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
647542d5
Commit
647542d5
authored
Apr 16, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
ff188675
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
17 deletions
+26
-17
Expression.php
lib/Doctrine/Expression.php
+11
-0
Query.php
lib/Doctrine/Query.php
+15
-17
No files found.
lib/Doctrine/Expression.php
View file @
647542d5
...
...
@@ -661,4 +661,15 @@ class Doctrine_Expression extends Doctrine_Connection_Module
{
throw
new
Doctrine_Expression_Exception
(
'method not implemented'
);
}
/**
* __call
*
* for all native RDBMS functions the function name itself is returned
*/
public
function
__call
(
$m
,
$a
)
{
if
(
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_PORTABILITY
)
&
Doctrine
::
PORTABILITY_EXPR
)
{
throw
new
Doctrine_Expression_Exception
(
'Unknown expression '
.
$m
);
}
}
}
lib/Doctrine/Query.php
View file @
647542d5
...
...
@@ -235,52 +235,50 @@ class Doctrine_Query extends Doctrine_Hydrate implements Countable {
$pos
=
strpos
(
$func
,
'('
);
$name
=
substr
(
$func
,
0
,
$pos
);
if
(
method_exists
(
$this
->
conn
->
expression
,
$name
))
{
try
{
$argStr
=
substr
(
$func
,
(
$pos
+
1
),
-
1
);
$args
=
explode
(
','
,
$argStr
);
$func
=
call_user_func_array
(
array
(
$this
->
conn
->
expression
,
$name
),
$args
);
if
(
substr
(
$func
,
0
,
1
)
!==
'('
)
{
$pos
=
strpos
(
$func
,
'('
);
$name
=
substr
(
$func
,
0
,
$pos
);
}
else
{
$name
=
$func
;
}
$e2
=
explode
(
' '
,
$args
[
0
]);
$distinct
=
''
;
if
(
count
(
$e2
)
>
1
)
{
if
(
strtoupper
(
$e2
[
0
])
==
'DISTINCT'
)
$distinct
=
'DISTINCT '
;
$args
[
0
]
=
$e2
[
1
];
}
$parts
=
explode
(
'.'
,
$args
[
0
]);
$owner
=
$parts
[
0
];
$alias
=
(
isset
(
$e
[
1
]))
?
$e
[
1
]
:
$name
;
$e3
=
explode
(
'.'
,
$alias
);
if
(
count
(
$e3
)
>
1
)
{
$alias
=
$e3
[
1
];
$owner
=
$e3
[
0
];
}
// a function without parameters eg. RANDOM()
if
(
$owner
===
''
)
{
$owner
=
0
;
}
$this
->
pendingAggregates
[
$owner
][]
=
array
(
$name
,
$args
,
$distinct
,
$alias
);
}
else
{
throw
new
Doctrine_Query_Exception
(
'Unknown function '
.
$name
);
}
catch
(
Doctrine_Expression_Exception
$e
)
{
throw
new
Doctrine_Query_Exception
(
'Unknown function '
.
$func
.
'.'
);
}
}
public
function
processPendingSubqueries
()
...
...
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