Ejemplo n.º 1
0
 public function delete()
 {
     if ($this->id) {
         if ($this->hasModelType('VT')) {
             $this->deleteParticiple();
         }
         if ($this->hasModelType('VT') || $this->hasModelType('V')) {
             $this->deleteLongInfinitive();
         }
         LexemDefinitionMap::deleteByLexemId($this->id);
         Meaning::delete_all_by_lexemId($this->id);
         Relation::delete_all_by_lexemId($this->id);
         LexemModel::delete_all_by_lexemId($this->id);
     }
     // Clear the variantOfId field for lexems having $this as main.
     $lexemsToClear = Lexem::get_all_by_variantOfId($this->id);
     foreach ($lexemsToClear as $l) {
         $l->variantOfId = null;
         $l->save();
     }
     parent::delete();
 }
Ejemplo n.º 2
0
 public function delete()
 {
     if ($this->id) {
         if ($this->modelType == 'VT') {
             $this->deleteParticiple($this->modelNumber);
         }
         if ($this->modelType == 'VT' || $this->modelType == 'V') {
             $this->deleteLongInfinitive();
         }
         LexemDefinitionMap::deleteByLexemId($this->id);
         InflectedForm::deleteByLexemId($this->id);
     }
     parent::delete();
 }