public function getParent() { if (!empty($this->parents)) { return $this->parents[0]; } else { return null; } }