public function getId() { $identity = $this->getIdentity(); return $identity !== null ? $identity->getId() : null; }
/** * @param string $default * * @return string */ protected function getIdentifier($default) { $id = $default; if ($this->user instanceof User && !$this->user->getIsGuest()) { $id = $this->user->getId(); } return $id; }