I implement my model in the same way as the quick start guide .
In my model, I am trying to implement the findByToken() method. The current find() method takes the $id parameter, but I want to find the value of another column.
//excerpt from the quickstart guide public function find($id, Default_Model_Guestbook $guestbook) { $result = $this->getDbTable()->find($id); if (0 == count($result)) { return; } $row = $result->current(); $guestbook->setId($row->id) ->setEmail($row->email) ->setComment($row->comment) ->setCreated($row->created); }
I tried to do something similar, but I don't think it worked:
$db = $this->getDbTable(); $where = $db->getAdapter()->quoteInto('token = ?', $token); $result = $db->find($where);
How can I find a row by the value of the specified column?
source share