public function getParentId() { $parent = $this->getEntity()->getParent(); if ($parent) { return $parent->getId(); } return; }