ReviewsService
in package
Table of Contents
Properties
- $connection : mixed
- $logService : mixed
- $reviewsApi : mixed
- $entityManager : EntityManagerInterface
Methods
- __construct() : mixed
- getRepo() : CustomerReviewRepository
- getReviewOrderTypes() : array<string|int, mixed>|string|null
- Retrieves review order types or a specific order type description if provided.
- getReviewsBySourceFromApi() : array<string|int, mixed>
- Retrieves reviews from the specified source using an external API.
- save() : mixed
Properties
$connection
protected
mixed
$connection
$logService
protected
mixed
$logService
$reviewsApi
protected
mixed
$reviewsApi
$entityManager
private
EntityManagerInterface
$entityManager
Methods
__construct()
public
__construct(LogServiceInterface $logService, ReviewsApi $reviewsApi, EntityManagerInterface $entityManager[, Connection|null $connection = null ]) : mixed
Parameters
- $logService : LogServiceInterface
- $reviewsApi : ReviewsApi
- $entityManager : EntityManagerInterface
- $connection : Connection|null = null
getRepo()
public
getRepo() : CustomerReviewRepository
Return values
CustomerReviewRepositorygetReviewOrderTypes()
Retrieves review order types or a specific order type description if provided.
public
static getReviewOrderTypes([string|null $orderType = null ]) : array<string|int, mixed>|string|null
Parameters
- $orderType : string|null = null
-
The identifier of the order type to retrieve. If null, returns all order types.
Return values
array<string|int, mixed>|string|null —Returns an array of all order types if no specific type is provided. Returns the description of a specific order type if the identifier exists. Returns null if the identifier does not exist.
getReviewsBySourceFromApi()
Retrieves reviews from the specified source using an external API.
public
getReviewsBySourceFromApi([int $page = 1 ][, string $source = 'menzzo.fr' ]) : array<string|int, mixed>
Parameters
- $page : int = 1
-
The page number of the reviews to retrieve. Defaults to 1.
- $source : string = 'menzzo.fr'
-
The source from which to fetch reviews. Defaults to 'menzzo.fr'.
Return values
array<string|int, mixed> —An array of reviews if successfully retrieved, otherwise an empty array.
save()
public
save(mixed $entity) : mixed
Parameters
- $entity : mixed