Skip to content

Commit 5d93988

Browse files
committed
* Projection with alias fixed for sqlite dialect
1 parent 6575005 commit 5d93988

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

doc/ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2011-07-18 Evgeny V. Kokovikhin
2+
3+
* main/Criteria/Projections/CountProjection.class.php,
4+
main/Criteria/Projections/PropertyProjection.class.php:
5+
criteria's query for sqlite fixed
6+
17
2011-07-26 Dmitry V. Snezhinskiy, Alexey S. Denisov
28

39
* main/Flow/JsonView.class.php,

main/Criteria/Projections/CountProjection.class.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ abstract class CountProjection extends BaseProjection
1919
**/
2020
public function process(Criteria $criteria, JoinCapableQuery $query)
2121
{
22-
return $query->get($this->getFunction($criteria, $query));
22+
return
23+
$query->get(
24+
$this->getFunction($criteria, $query),
25+
$this->alias
26+
);
2327
}
2428

2529
/**
@@ -38,8 +42,7 @@ protected function getFunction(
3842
$this->property
3943
? $criteria->getDao()->guessAtom($this->property, $query)
4044
: $criteria->getDao()->getIdName()
41-
)->
42-
setAlias($this->alias);
45+
);
4346
}
4447
}
4548
?>

main/Criteria/Projections/PropertyProjection.class.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ public function process(Criteria $criteria, JoinCapableQuery $query)
2222
Assert::isNotNull($this->property);
2323

2424
return $query->get(
25-
SelectField::create(
26-
$criteria->getDao()->guessAtom($this->property, $query),
27-
$this->alias
28-
)
25+
$criteria->getDao()->guessAtom($this->property, $query),
26+
$this->alias
2927
);
3028
}
3129
}

0 commit comments

Comments
 (0)