Permalink
Browse files

Update framework/db/ar/CActiveRecord.php

Если в ActiveRecord переопределить метод getTableAlias, то будут возникать ошибки неизвестной таблицы t, а так он будет использовать текущий алиас у таблицы
  • Loading branch information...
1 parent cf1c20c commit 8afb3b5855524b8a02dd8d2813c1de91b6d81466 @s-larionov s-larionov committed Jan 28, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 framework/db/ar/CActiveRecord.php
View
2 framework/db/ar/CActiveRecord.php
@@ -1294,7 +1294,7 @@ protected function query($criteria,$all=false)
{
if(!$all)
$criteria->limit=1;
- $command=$this->getCommandBuilder()->createFindCommand($this->getTableSchema(),$criteria);
+ $command=$this->getCommandBuilder()->createFindCommand($this->getTableSchema(),$criteria,$this->getTableAlias(false));
return $all ? $this->populateRecords($command->queryAll(), true, $criteria->index) : $this->populateRecord($command->queryRow());
}
else

0 comments on commit 8afb3b5

Please sign in to comment.