master

laravel/framework

Last updated at: 29/12/2023 09:21

EntityNotFoundException.php

TLDR

This file is a part of the Illuminate\Contracts\Queue namespace and defines the EntityNotFoundException class, which extends the InvalidArgumentException class. It contains a constructor method to create a new exception instance.

Classes

EntityNotFoundException

This class extends the InvalidArgumentException class. It is used to represent an exception that occurs when a queueable entity is not found for a given ID. It has a constructor method that takes in the type and ID of the entity and sets the exception message accordingly.

<?php

namespace Illuminate\Contracts\Queue;

use InvalidArgumentException;

class EntityNotFoundException extends InvalidArgumentException
{
    /**
     * Create a new exception instance.
     *
     * @param  string  $type
     * @param  mixed  $id
     * @return void
     */
    public function __construct($type, $id)
    {
        $id = (string) $id;

        parent::__construct("Queueable entity [{$type}] not found for ID [{$id}].");
    }
}