The ORM find_by_* method is gone. (Kohana 2.2)

According to this post in the kohana forum, the findby* method of ORM is not avaliable since Kohana 2.2 because the performance issue.

In the previous version, Kohana 2.1.2, I used before. I can use findby*() method like this:

$user = new User_Model();
$user->find_by_username('tzangms');

But for now, in Kohana 2.2, we should use where() instead, if we want to find by username, not by id.

$user = new User_Model()
$user->where('username', 'tzangms')->find();

damn, findby* is so intuitive.

tzangms

Read more posts by this author.

Subscribe to Oceanic / 海海人生

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!