public function setNodeType(NodeType $nodeType) { if ($this->nodeType !== $nodeType->getName()) { $this->nodeType = $nodeType->getName(); $this->addOrUpdate(); } }