CActiveRecord::find is not doing well

hi,

I have the following statement :


$account = Account::model()->find(array('conditidons' => array("email=:email"), 'params'=>array(':email' => $this->email)));

in my query log I saw the following query being executed :


2010/02/05 05:00:11 [trace] [system.db.CDbCommand] Querying SQL: SELECT * FROM `accounts` `t` LIMIT 1

This is not right. I believe it has to consider the passed ‘email’ condition in the query.

Am I wrong people ?

greetings,

Phiras

conditions

Uh, sorry that was a type mistake, my code is :


$account = Account::model()->find(array('conditions' => array("email=:email"), 'params'=>array(':email' => $this->email)));

and it generates the same query, which is not considering email parameter.

greetings,

Phiras

I think is not conditions but condition (without s)

Also, condition should be a string, not an array.

A simpler way to achieve the same result is




$account = Account::model()->find("email=:email", array(':email' => $this->email));