Beispiel #1
0
function saveModel($modelNumber, $infinitive, $longInfinitive, $imperative, $slaveModels, $participle, $gerund, $participleModel, $present, $subjonctive, $imperfect, $perfectSimple, $pastPerfect)
{
    $forms = array();
    $inflections = array();
    $forms[] = $infinitive;
    $inflections[] = INFL_INFINITIVE;
    $forms[] = $longInfinitive;
    $inflections[] = INFL_LONG_INFINITIVE;
    $forms[] = $imperative;
    $inflections[] = INFL_IMPERATIVE;
    $forms[] = $participle;
    $inflections[] = INFL_PARTICIPLE;
    $forms[] = $gerund;
    $inflections[] = INFL_GERUND;
    addPersonalForms($forms, $inflections, $present, INFL_PRESENT);
    addPersonalForms($forms, $inflections, $subjonctive, INFL_SUBJONCTIVE);
    addPersonalForms($forms, $inflections, $imperfect, INFL_IMPERFECT);
    addPersonalForms($forms, $inflections, $perfectSimple, INFL_PERFECT_SIMPLE);
    addPersonalForms($forms, $inflections, $pastPerfect, INFL_PAST_PERFECT);
    saveCommonModel('V', $modelNumber, $forms, '', $inflections);
    // Add the mapping from this verb model to the corresponding adjective model
    $pm = ParticipleModel::create($modelNumber, $participleModel);
    $pm->save();
    foreach ($slaveModels as $sm) {
        $mm = ModelMapping::create('V', $sm, $modelNumber);
        $mm->save();
    }
}