Bolt\Asset\Widget\Queue::countItemsInQueue PHP Method

countItemsInQueue() public method

Get the number of queued widgets.
public countItemsInQueue ( string $location, string $zone = Zone::FRONTEND ) : boolean
$location string Location (e.g. 'dashboard_aside_top')
$zone string Either Zone::FRONTEND or Zone::BACKEND
return boolean
    public function countItemsInQueue($location, $zone = Zone::FRONTEND)
    {
        $count = 0;
        foreach ($this->queue as $widget) {
            if ($widget->getZone() === $zone && $widget->getLocation() === $location) {
                $count++;
            }
        }
        return $count;
    }