38 lines
936 B
PHP
38 lines
936 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\BusProNet\Model;
|
|
|
|
/**
|
|
* Represents a notification with code and message information.
|
|
*
|
|
* This class handles notification data including error codes and messages
|
|
* for API response handling. It provides methods to determine if the
|
|
* notification represents an error condition.
|
|
*/
|
|
class Notification
|
|
{
|
|
public function __construct(int $code, string $message)
|
|
{
|
|
$this->code = $code;
|
|
$this->message = $message;
|
|
}
|
|
|
|
public ?int $code;
|
|
public ?string $message;
|
|
|
|
/**
|
|
* Determines if the notification represents an error.
|
|
*
|
|
* Returns true if the notification code is not 650 (success code).
|
|
* Code 650 is used for successful operations in the BusProNet API.
|
|
*
|
|
* @return bool True if the notification is an error, false otherwise
|
|
*/
|
|
public function isError(): bool
|
|
{
|
|
return 650 !== $this->code;
|
|
}
|
|
}
|