mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-05-07 20:32:26 +00:00
34 lines
824 B
PHP
34 lines
824 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Exceptions\Api;
|
|
|
|
class EntityStillInUseApiException extends ApiException
|
|
{
|
|
private string $modelToDelete;
|
|
|
|
private string $modelInUse;
|
|
|
|
public function __construct(string $modelToDelete, string $modelInUse)
|
|
{
|
|
parent::__construct();
|
|
$this->modelToDelete = $modelToDelete;
|
|
$this->modelInUse = $modelInUse;
|
|
}
|
|
|
|
public const string KEY = 'entity_still_in_use';
|
|
|
|
/**
|
|
* Get the translated message for the exception.
|
|
*/
|
|
#[\Override]
|
|
public function getTranslatedMessage(): string
|
|
{
|
|
return __('exceptions.api.'.$this->getKey(), [
|
|
'modelToDelete' => __('validation.entities.'.$this->modelToDelete),
|
|
'modelInUse' => __('validation.entities.'.$this->modelInUse),
|
|
]);
|
|
}
|
|
}
|