public function addListModel(\MUtil_Model_ModelAbstract $model, array $joins, $name = null)
    {
        if (null === $name) {
            $name = $model->getName();
        }

        $trans = new \MUtil_Model_Transform_NestedTransformer();
        $trans->skipSave = true;
        $trans->addModel($model, $joins);

        $this->addTransformer($trans);
        $this->set($name,
            'model', $model,
            'elementClass', 'FormTable',
            'type', \MUtil_Model::TYPE_CHILD_MODEL
        );

        $bridge = $model->getBridgeFor('table');
        $this->set($name, 'formatFunction', array($bridge, 'displayListTable'));

        return $trans;
    }
public function addListModel(\MUtil_Model_ModelAbstract $model, array $joins, $name = null)
    {
        if (null === $name) {
            $name = $model->getName();
        }

        $trans = new \MUtil_Model_Transform_NestedTransformer();
        $trans->skipSave = true;
        $trans->addModel($model, $joins);

        $this->addTransformer($trans);
        $this->set($name,
            'model', $model,
            'elementClass', 'FormTable',
            'type', \MUtil_Model::TYPE_CHILD_MODEL
        );

        $bridge = $model->getBridgeFor('table');
        $this->set($name, 'formatFunction', array($bridge, 'displayListTable'));

        return $trans;
    }
public function addListModel ( \ MUtil_Model_ModelAbstract $ model , array $ joins , $ name = null ) { if ( null === $ name ) { $ name = $ model -> getName ( ) ; } $ trans = new \ MUtil_Model_Transform_NestedTransformer ( ) ; $ trans -> skipSave = true ; $ trans -> addModel ( $ model , $ joins ) ; $ this -> addTransformer ( $ trans ) ; $ this -> set ( $ name , 'model' , $ model , 'elementClass' , 'FormTable' , 'type' , \ MUtil_Model :: TYPE_CHILD_MODEL ) ; $ bridge = $ model -> getBridgeFor ( 'table' ) ; $ this -> set ( $ name , 'formatFunction' , array ( $ bridge , 'displayListTable' ) ) ; return $ trans ; }
Add a 'submodel' field to the model.

You get a nested join where a set of rows is placed in the $name field
of each row of the parent model.

@param \MUtil_Model_ModelAbstract $model
@param array $joins The join fields for the sub model
@param string $name Optional 'field' name, otherwise model name is used
@return \MUtil_Model_Transform_NestedTransformer The added transformer
Add a submodel field to the model .