/** * @param ActivityInterface $object * @return null|array */ public function reverseConvert($object) { if ($object instanceof ActivityInterface) { // Retrieve user for activity $user = $object->getUser(); if ($user instanceof UserInterface) { $photo = $this->defaultAvatar; if (is_string($user->getPhoto())) { $photo = $this->cacheManager->getBrowserPath($user->getPhoto(), 'user_photo_review'); } return ['id' => $user->getId(), 'firstName' => $user->getFirstName(), 'middleName' => $user->getMiddleName(), 'lastName' => $user->getLastName(), 'photo' => $photo]; } } return null; }
/** * {@inheritdoc} */ public function getClient() { if ($this->activity instanceof ActivityInterface) { return $this->activity->getClient(); } return null; }