function loadParticiplesForVerbModel($modelNumber, $participleNumber) { $infl = Inflection::loadParticiple(); return Model::factory('Lexem')->table_alias('part')->join('InflectedForm', 'part.formNoAccent = i.formNoAccent', 'i')->join('Lexem', 'i.lexemId = infin.id', 'infin')->select('part.*')->where('infin.modelType', 'VT')->where('infin.modelNumber', $modelNumber)->where('i.inflectionId', $infl->id)->where('part.modelType', 'A')->where('part.modelNumber', $participleNumber)->order_by_asc('part.formNoAccent')->find_many(); }
/** * Called when the model type of a lexem changes from VT to something else. * Only deletes participles that do not have their own definitions. */ public function deleteParticiple() { $infl = Inflection::loadParticiple(); $adjModels = array(); foreach ($this->getLexemModels() as $lm) { if ($lm->modelType == 'V' || $lm->modelType == 'VT') { $pm = ParticipleModel::get_by_verbModel($lm->modelNumber); $adjModels[] = $pm->adjectiveModel; } } $this->_deleteDependentModels($infl->id, 'A', $adjModels); }
/** * Called when the model type of a lexem changes from VT to something else. * Only deletes participles that do not have their own definitions. */ public function deleteParticiple($oldModelNumber) { $infl = Inflection::loadParticiple(); $pm = ParticipleModel::loadByVerbModel($oldModelNumber); $this->_deleteDependentModels($infl->id, 'A', array($pm->adjectiveModel)); }