Browse Source

removed get() shortcut from find()

tags/2.0.0-beta
Carsten Brandt 11 years ago
parent
commit
35b5bd8ef4
  1. 8
      extensions/yii/elasticsearch/ActiveRecord.php

8
extensions/yii/elasticsearch/ActiveRecord.php

@ -66,14 +66,6 @@ class ActiveRecord extends BaseActiveRecord
{
$query = static::createQuery();
if (is_array($q)) {
if (count($q) == 1 && (array_key_exists(ActiveRecord::PRIMARY_KEY_NAME, $q)) && $query->where === null) {
$pk = $q[ActiveRecord::PRIMARY_KEY_NAME];
if (is_array($pk)) {
return static::mget($pk);
} else {
return static::get($pk);
}
}
return $query->andWhere($q)->one();
} elseif ($q !== null) {
return static::get($q);

Loading…
Cancel
Save