src/Traits/Transformations.php
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();
	}
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();
	}
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 ( ) ; }
Shortcut method for serializing and transforming an entity.

@param                                          $entity
@param TransformerAbstract|callable|string|null $transformer
@param SerializerAbstract|null                  $serializer

@return array
Shortcut method for serializing and transforming an entity .