/** * Transforms an issue array into an issue Entity object. * * @param \VersionControl\GitlabIssueBundle\Entity\Issues\IssueComment|null $issueComment * * @return string */ public function transform($issueComment) { if (null === $issueComment) { return null; } $issueCommentEntity = new IssueComment(); $issueCommentEntity->setId($issueComment['id']); $issueCommentEntity->setComment($issueComment['body']); $issueCommentEntity->setCreatedAt($this->formatDate($issueComment['created_at'])); if (isset($issueComment['updated_at'])) { $issueCommentEntity->setUpdatedAt($this->formatDate($issueComment['updated_at'])); } if (isset($issueComment['author']) && is_array($issueComment['author'])) { $user = $this->userTransformer->transform($issueComment['author']); $issueCommentEntity->setUser($user); } return $issueCommentEntity; }