Aller au contenu

omnireview/google Référence de l’API

Étage
Fournisseur · Omnireview
Version
1.x
Suite de conformité
non branchée
Vérifié en réel
Vérifié en partie
Licence
MIT
composer require omnireview/google:1.x-dev

Lue dans les fichiers PHP du paquet au commit 9f6acfa28a65 : ses espaces de noms, classes, interfaces et énumérations, leurs constantes, propriétés et méthodes publiques avec leur PHPDoc, et les options que prennent ses fabriques. Rien n’en est exécuté.

Omnireview\Google

  • GoogleGateway class

    Google: the Places API (New) for anyone's place - its rating, its number of ratings, up to five reviews -, and the Business Profile API for the owner's - every review, and replying.

    9 methods · 3 constants

  • GoogleGatewayFactory class

    Google reviews.

    5 options · 1 method

Omnireview\Google

GoogleGateway class

final class GoogleGateway implements RatingInterface, ReviewsInterface, ReplyInterface, WriteUrlInterface GoogleGateway.php:31

Google: the Places API (New) for anyone's place - its rating, its number of ratings, up to five reviews -, and the Business Profile API for the owner's - every review, and replying.

  • Places: GET https://places.googleapis.com/v1/places/{placeId}, X-Goog-Api-Key, X-Goog-FieldMask;
  • Business Profile: OAuth 2.0 (the owner's refresh token, scope business.manage), GET https://mybusiness.googleapis.com/v4/{accounts/a/locations/l}/reviews, PUT .../reviews/{reviewId}/reply.
const PLACES = 'https://places.googleapis.com/v1/places/'
const BUSINESS = 'https://mybusiness.googleapis.com/v4/'
const TOKEN = 'https://oauth2.googleapis.com/token'

GoogleGateway::__construct()

public function __construct(readonly HttpClientInterface $http, readonly ?string $apiKey = null, readonly ?string $clientId = null, readonly ?string $clientSecret = null, readonly ?string $refreshToken = null, readonly ?string $language = null)

GoogleGateway::getName()

public function getName(): string

GoogleGateway::getTitle()

public function getTitle(): string

GoogleGateway::capabilities()

public function capabilities(): Capabilities

GoogleGateway::terms()

public function terms(): Terms

GoogleGateway::rating()

public function rating(Place $place): Rating

GoogleGateway::reviews()

public function reviews(Place $place, int $limit = 5, ?string $language = null): array

GoogleGateway::reply()

public function reply(Place $place, Review $review, string $text): Reply

GoogleGateway::writeUrl()

public function writeUrl(Place $place): string

GoogleGatewayFactory class

final class GoogleGatewayFactory extends GatewayFactory GoogleGatewayFactory.php:25

Google reviews.

options: api_key: '%env(GOOGLE_PLACES_KEY)%' # the Places API (New): anyone's place, up to five reviews language: fr # the reviews' language (languageCode) # the owner's side, the Business Profile API: every review, replying client_id: '%env(default::GOOGLE_CLIENT_ID)%' client_secret: '%env(default::GOOGLE_CLIENT_SECRET)%' refresh_token: '%env(default::GOOGLE_REFRESH_TOKEN)%' # granted once by the owner, scope business.manage

The api_key, the owner's three, or both.

Options

OptionDefault
api_keynull
languagenull
client_idnull
client_secretnull
refresh_tokennull

GoogleGatewayFactory::__construct()

public function __construct(readonly ?HttpClientInterface $http = null)