2009年12月18日星期五

Re: [fw-db] model autoloader

AFAIK there are no short model class names. In #findDependentRowset(), you must pass in the full class name or an instance of the class.

If you want to save some keystrokes you can maybe build a model name action helper. Something like:

class Default_Action_Helper_Model
{
    public function direct($name)
    {
        return 'Default_Model_' . $name;
    }
}

--
Hector


On Fri, Dec 18, 2009 at 3:57 PM, monk.e.boy <john@teethgrinder.co.uk> wrote:

Hi,

 I think I am being a bit thick, but I have read and googled and I am still
stuck.

 I can't access my model classes with short names, I need to use:

$test = new Default_Model_DbTable_Test();
$select  = $test->select()->where('id=?', (int)$id);
$t = $test->fetchRow($select);

$select = $test->select()->order('order ASC');
$this->view->sections =
$t->findDependentRowset('Default_Model_DbTable_Children', 'Test', $select);

 How can I use short model class names?

 Thanks,

 monk.e.boy
--
View this message in context: http://n4.nabble.com/model-autoloader-tp975174p975174.html
Sent from the Zend DB mailing list archive at Nabble.com.


没有评论: