CRM V2

Stats extends CrmClientModel
in package

This class is used to get stats from CRM

Tags
throws
ApiErrorException

If an error occurs

throws
CrmException

If the CRM encounters an error

category

Api Models

subpackage

models

author

Jérémy Munsch jeremy.munsch@ldc.fr

Table of Contents

$validation  : array<string|int, mixed>
Validation rules
getBrandStats()  : array<string|int, mixed>
Get brand stats ordered by ascendent days
getQuestionStats()  : array<string|int, mixed>
Get brand stats ordered by ascendent days

Properties

$validation

Validation rules

protected static array<string|int, mixed> $validation = ['question.id' => 'required|int|min:1', 'start' => 'required|date_format:Y-m-d', 'end' => 'required|date_format:Y-m-d']

Methods

getBrandStats()

Get brand stats ordered by ascendent days

public static getBrandStats(string $start, string $end) : array<string|int, mixed>
Parameters
$start : string

Une date valide au format Y-m-d .

$end : string

Une date valide au format Y-m-d .

Tags
throws
ValidationException

If a field start could not be validated.

throws
ValidationException

If a field end could not be validated.

throws
CrmException

If an error occurs on server side or on getting response.

throws
ApiErrorException

If any error or \LDC\LDCCRM\Enums\ApiError occurs. Possibles are : - validationFailed, If provided data is wrong(CRM side).

phpcs:ignore

Squiz.Commenting.FunctionCommentThrowTag.WrongNumber

Return values
array<string|int, mixed> —

The stats array by day

getQuestionStats()

Get brand stats ordered by ascendent days

public static getQuestionStats(Question $question, string $start, string $end) : array<string|int, mixed>
Parameters
$question : Question

Une question CRM possèdant un id réel.

$start : string

Une date valide au format Y-m-d .

$end : string

Une date valide au format Y-m-d .

Tags
throws
ValidationException

If a question's id could not be validated.

throws
ValidationException

If a field start could not be validated.

throws
ValidationException

If a field end could not be validated.

throws
CrmException

If an error occurs on server side or on getting response.

throws
ApiErrorException

If any error or \LDC\LDCCRM\Enums\ApiError occurs. Possibles are : - validationFailed, If provided data is wrong(CRM side).

phpcs:ignore

Squiz.Commenting.FunctionCommentThrowTag.WrongNumber

Return values
array<string|int, mixed> —

The stats array by day

Search results