Using a FindByAttributes query I would like to get the oldest element out of my database.
My Code:
$oMemberLocked = MembersLocked::model()->findByAttributes(array(
'lockedid' => $this->id,
'request' => 2,
));
The object MembersLocked has a attribute ‘date’.
How can I get the element with the largest date?
You can order the query by ascending date.