master

laravel/framework

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

QueueableCollection.php

TLDR

The QueueableCollection interface provides methods to retrieve information about the entities being queued.

Methods

getQueueableClass

This method returns the type of the entities being queued. It returns a string representing the class name of the entities. If the entities being queued belong to different classes, this method should return null.

getQueueableIds

This method returns the identifiers for all of the entities being queued. It returns an array of integers representing the IDs of the entities. The order of the IDs in the array should match the order of the entities in the collection.

getQueueableRelations

This method returns the relationships of the entities being queued. It returns an array of strings representing the names of the relationships. Each string should be the name of a method on the entity that defines the relationship.

getQueueableConnection

This method returns the connection of the entities being queued. It returns a string representing the name of the database connection that should be used when queuing the entities. If no specific connection is defined, this method should return null.

END

<?php

namespace Illuminate\Contracts\Queue;

interface QueueableCollection
{
    /**
     * Get the type of the entities being queued.
     *
     * @return string|null
     */
    public function getQueueableClass();

    /**
     * Get the identifiers for all of the entities.
     *
     * @return array<int, mixed>
     */
    public function getQueueableIds();

    /**
     * Get the relationships of the entities being queued.
     *
     * @return array<int, string>
     */
    public function getQueueableRelations();

    /**
     * Get the connection of the entities being queued.
     *
     * @return string|null
     */
    public function getQueueableConnection();
}