public function afterAdd($p, $m)
    {
        if ($p->titleForModel) {
            $m->title_field = $p->titleForModel;
        }

        foreach ($this->fieldsForModel as $field=>$def) {
            if ($m->hasField($field)) {
                continue;
            }

            // add new field
            $m->addField($field, $def);
        }
    }
public function afterAdd($p, $m)
    {
        if ($p->titleForModel) {
            $m->title_field = $p->titleForModel;
        }

        foreach ($this->fieldsForModel as $field=>$def) {
            if ($m->hasField($field)) {
                continue;
            }

            // add new field
            $m->addField($field, $def);
        }
    }
public function afterAdd ( $ p , $ m ) { if ( $ p -> titleForModel ) { $ m -> title_field = $ p -> titleForModel ; } foreach ( $ this -> fieldsForModel as $ field => $ def ) { if ( $ m -> hasField ( $ field ) ) { continue ; } // add new field $ m -> addField ( $ field , $ def ) ; } }
Automatically adds missing model fields.
Called from AfterAdd hook.

@param Persistence_Static $p
@param Model              $m
Automatically adds missing model fields . Called from AfterAdd hook .