$entity->getId(), 'userId' => $entity->getUserId(), 'postId' => $entity->getPostId(), 'time' => $this->entityTimeToDbTime($entity->getTime()), 'score' => $entity->getScore(), ]; } public function toBasicEntity(array $array) { $entity = new \Szurubooru\Entities\PostScore($array['id']); $entity->setUserId($array['userId']); $entity->setPostId($array['postId']); $entity->setTime($this->dbTimeToEntityTime($array['time'])); $entity->setScore(intval($array['score'])); return $entity; } }