/** * @return int */ public function getId() { if ($this->hasDependencies()) { return $this->entity->getId(); } else { return 0; } }