|
Re: Best practices in a thin-controller application: msg#00145php.zend.framework.mvc
On Wed, Jul 23, 2008 at 8:47 AM, Bryce Lohr <brycel-kr8tFwxIqV2MVkprmlnVt0B+6BGkLq7r@xxxxxxxxxxxxxxxx> wrote: HI David, OK, what about class MyModel { protected $table; protected $row; function __construct ($id = null) { $this->table = new My_Subclass_Of_Zend_Db_Table_Abstract(); if ($id) { // pretend you validated, for brevity's sake $this->row = $this->table->find($id)->current();
if (!$this->row) throw new Exception("d'oh!"); // or throw your subclass } else { $this->row = $this->table->createRow(); } } -- David Mintz http://davidmintz.org/ The subtle source is clear and bright The tributary streams flow through the darkness |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: Zend_Test: 00145, Steven Brown |
|---|---|
| Next by Date: | Re: Zend_Test: 00145, Емил Иванов / Emil Ivanov |
| Previous by Thread: | Re: Best practices in a thin-controller applicationi: 00145, Bryce Lohr |
| Next by Thread: | Re: Best practices in a thin-controller application: 00145, Bryce Lohr |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |