diff --git a/lib/Annotation/Model/Table.php b/lib/Annotation/Model/Table.php index 34314e9..3271372 100644 --- a/lib/Annotation/Model/Table.php +++ b/lib/Annotation/Model/Table.php @@ -949,7 +949,7 @@ protected function writeRelationsGetterAndSetter(WriterInterface $writer) ->write('public function set'.$nameSingular.'('.$typehints['set_arg'].'$'.$this->getNaming($foreign->getReferencedTable()->getName()).')'.$typehints['set_return']) ->write('{') ->indent() - ->write('$this->'.$this->getNaming($this->getRelatedVarName($foreign->getReferencedTable()->getName(), $related)).' = $'.$this->getNaming($foreign->getReferencedTable()->getModelName()).';') + ->write('$this->'.$this->getNaming($this->getRelatedVarName($foreign->getReferencedTable()->getName(), $related)).' = $'.$this->getNaming($foreign->getReferencedTable()->getName()).';') ->write('') ->write('return $this;') ->outdent()