public function transformEntity($entity, $transformer = null, SerializerAbstract $serializer = null): array
	{
		$transformer = $transformer ?: $this->getTransformerFromClassProperty();

		$results = $this->transform()->resourceWith($entity, $transformer)->usingPaginatorIfPaged();

		if ($serializer) {
			return $results->serialize($serializer);
		}

		return $results->serialize();
	}