Documentation

BillingEntryController extends BaseApiController
in package

Table of Contents

$errorLogName  : string
$warningLogName  : string
$apiVersionManager  : ApiVersionManager
This service manages the api versions
$ensureApiVersions  : array<string|int, mixed>
Array of api versions for which, the controller that extends this Base, is available
$jobsLogName  : string
The name of the log in which we are going to log actions performed by jobs
__construct()  : mixed
Constructor, it ensures that the API version is valid for this element (i.e. the apiVersion should be minimum the one in which the functionalities was added)
destroy()  : BillingEntryResource|JsonResponse
Remove the specified resource from storage.
fetchForAllProjects()  : BillingEntryResourceCollection|JsonResponse
Fetch all billing entries related to all project without an invoice
fetchForProject()  : BillingEntryResourceCollection|JsonResponse
Fetch all billing entries related to project without an invoice
generic401JsonError()  : JsonResponse
This function can be used anywhere in the code if you need to return a standard 401 unauth response
generic403JsonError()  : JsonResponse
This function can be used anywhere in the code if you need to return a standard 403 unauth response
generic404JsonError()  : JsonResponse
This function can be used anywhere in the code if you need to return a standard 404 unauth response
generic500JsonError()  : JsonResponse
This function can be used anywhere in code if there is an application error
index()  : BillingEntryResourceCollection|JsonResponse
Display a listing of the resource.
jsonResponse()  : JsonResponse
logEntry()  : Activity
logEntryWithoutModel()  : Activity
logError()  : Activity
logWarning()  : Activity
show()  : BillingEntryResource|JsonResponse
Display the specified resource.
store()  : BillingEntryResource|JsonResponse
Store a newly created resource in storage.
update()  : BillingEntryResource|JsonResponse
Update the specified resource in storage.
validationJsonError()  : JsonResponse
Returns a 422 error
can()  : mixed
This function will check if the user can, given the policy for the $model, do the specified $action In case it will satisfy the requirements the $callback will be used to build a response, otherwise a json with the system wide defined response will be used as a return value.
ensureApiVersions()  : void
This method will just save the apiVersions that have to checked.
log()  : array<string|int, Activity>
jsonError()  : JsonResponse

Properties

$warningLogName

public static string $warningLogName = "warning"

$ensureApiVersions

Array of api versions for which, the controller that extends this Base, is available

protected array<string|int, mixed> $ensureApiVersions

$jobsLogName

The name of the log in which we are going to log actions performed by jobs

protected string $jobsLogName = "jobs"

Methods

__construct()

Constructor, it ensures that the API version is valid for this element (i.e. the apiVersion should be minimum the one in which the functionalities was added)

public __construct(ApiVersionManager $apiVersionManager) : mixed
Parameters
$apiVersionManager : ApiVersionManager
Return values
mixed

generic401JsonError()

This function can be used anywhere in the code if you need to return a standard 401 unauth response

public static generic401JsonError() : JsonResponse
Return values
JsonResponse

generic403JsonError()

This function can be used anywhere in the code if you need to return a standard 403 unauth response

public static generic403JsonError() : JsonResponse
Return values
JsonResponse

generic404JsonError()

This function can be used anywhere in the code if you need to return a standard 404 unauth response

public static generic404JsonError() : JsonResponse
Return values
JsonResponse

generic500JsonError()

This function can be used anywhere in code if there is an application error

public static generic500JsonError(array<string|int, mixed> $errors) : JsonResponse
Parameters
$errors : array<string|int, mixed>
Return values
JsonResponse

jsonResponse()

public static jsonResponse(array<string|int, mixed> $data) : JsonResponse
Parameters
$data : array<string|int, mixed>
Return values
JsonResponse

logEntry()

public static logEntry(Model $model, array<string|int, mixed> $properties, string $description, string $event, string $logName) : Activity
Parameters
$model : Model
$properties : array<string|int, mixed>
$description : string
$event : string
$logName : string
Return values
Activity

logEntryWithoutModel()

public static logEntryWithoutModel(array<string|int, mixed> $properties, string $description, string $event, string $logName) : Activity
Parameters
$properties : array<string|int, mixed>
$description : string
$event : string
$logName : string
Return values
Activity

logError()

public static logError(Model $model, array<string|int, mixed> $properties, string $description, string $event) : Activity
Parameters
$model : Model
$properties : array<string|int, mixed>
$description : string
$event : string
Return values
Activity

logWarning()

public static logWarning(Model $model, array<string|int, mixed> $properties, string $description, string $event) : Activity
Parameters
$model : Model
$properties : array<string|int, mixed>
$description : string
$event : string
Return values
Activity

validationJsonError()

Returns a 422 error

public static validationJsonError(array<string|int, mixed> $data, string $errorKey, string $message) : JsonResponse
Parameters
$data : array<string|int, mixed>
$errorKey : string
$message : string
Return values
JsonResponse

can()

This function will check if the user can, given the policy for the $model, do the specified $action In case it will satisfy the requirements the $callback will be used to build a response, otherwise a json with the system wide defined response will be used as a return value.

protected can(Request $request, string $action, string|Model $model,  $callback[, bool $forceYes = false ]) : mixed

This function will also check if the current apiVersion is one of those for which the controller that extends this Base is available.

Parameters
$request : Request
$action : string
$model : string|Model
$callback :
$forceYes : bool = false

If this parameter is true this function will not check the policy

Return values
mixed

ensureApiVersions()

This method will just save the apiVersions that have to checked.

protected ensureApiVersions(array<string|int, mixed> $versions) : void

The real check will be done in the "can" function

Parameters
$versions : array<string|int, mixed>
Return values
void

log()

protected log(Model|array<string|int, mixed> $models, array<string|int, mixed> $properties, string $description[, null $logName = null ]) : array<string|int, Activity>
Parameters
$models : Model|array<string|int, mixed>
$properties : array<string|int, mixed>
$description : string
$logName : null = null
Return values
array<string|int, Activity>

jsonError()

private static jsonError(int $code, array<string|int, mixed> $errors) : JsonResponse
Parameters
$code : int
$errors : array<string|int, mixed>
Return values
JsonResponse

Search results