DbRepository: Handle columns of type Zend_Db_Expr #2

This commit is contained in:
Johannes Meyer 2015-12-07 09:55:25 +01:00
parent 0d1d3c3b8f
commit 64f13f0512
1 changed files with 8 additions and 0 deletions

View File

@ -503,6 +503,10 @@ abstract class DbRepository extends Repository implements Extensible, Updatable,
public function providesValueConversion($table, $column = null)
{
if ($column !== null) {
if ($column instanceof Zend_Db_Expr) {
return false;
}
if ($this->validateQueryColumnAssociation($table, $column)) {
return parent::providesValueConversion($table, $column);
}
@ -536,6 +540,10 @@ abstract class DbRepository extends Repository implements Extensible, Updatable,
*/
protected function getConverter($table, $name, $context, RepositoryQuery $query = null)
{
if ($name instanceof Zend_Db_Expr) {
return null;
}
if (
! ($query !== null && $this->validateQueryColumnAssociation($table, $name))
&& !($query === null && $this->validateStatementColumnAssociation($table, $name))