public function convertParentToInteger() { if ($this->parent) { return $this->parent->getId(); } return 0; }