本文整理汇总了PHP中Illuminate\Contracts\Events\Dispatcher::until方法的典型用法代码示例。如果您正苦于以下问题:PHP Dispatcher::until方法的具体用法?PHP Dispatcher::until怎么用?PHP Dispatcher::until使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Contracts\Events\Dispatcher
的用法示例。
在下文中一共展示了Dispatcher::until方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: daemonShouldRun
/**
* Determine if the daemon should process on this iteration.
*
* @return bool
*/
protected function daemonShouldRun()
{
if ($this->manager->isDownForMaintenance()) {
return false;
}
return $this->events->until('illuminate.queue.looping') !== false;
}
示例2: getCustomRelationship
/**
* Get a custom relationship.
*
* @param mixed $model
* @param string $name
* @return Relationship|null
*/
protected function getCustomRelationship($model, $name)
{
$relationship = static::$dispatcher->until(new GetApiRelationship($this, $name, $model));
if ($relationship && !$relationship instanceof Relationship) {
throw new LogicException('GetApiRelationship handler must return an instance of ' . Relationship::class);
}
return $relationship;
}
示例3: callRouteFilter
/**
* Call the given route filter.
*
* @param string $filter
* @param array $parameters
* @param \Illuminate\Routing\Route $route
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Http\Response|null $response
* @return mixed
*/
public function callRouteFilter($filter, $parameters, $route, $request, $response = null)
{
if (!$this->filtering) {
return null;
}
$data = array_merge(array($route, $request, $response), $parameters);
return $this->events->until('router.filter: ' . $filter, $this->cleanFilterParameters($data));
}
示例4: getCustomRelationship
/**
* Get a custom relationship.
*
* @param string $name
* @return BuilderInterface|null
*/
protected function getCustomRelationship($name)
{
$builder = static::$dispatcher->until(new GetApiRelationship($this, $name));
if ($builder && !$builder instanceof BuilderInterface) {
throw new LogicException('GetApiRelationship handler must return an instance of ' . BuilderInterface::class);
}
return $builder;
}
示例5: daemonShouldRun
/**
* Determine if the daemon should process on this iteration.
*
* @return bool
*/
protected function daemonShouldRun()
{
if ($this->manager->isDownForMaintenance() || $this->events->until('illuminate.queue.looping') === false) {
// If the application is down for maintenance or doesn't want the queues to run
// we will sleep for one second just in case the developer has it set to not
// sleep at all. This just prevents CPU from maxing out in this situation.
$this->sleep(1);
return false;
}
return true;
}
示例6: callRouteFilter
/**
* Call the given route filter.
*
* @param string $filter
* @param array $parameters
* @param \Illuminate\Routing\Route $route
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Http\Response|null $response
* @return mixed
*
* @deprecated since version 5.1.
*/
public function callRouteFilter($filter, $parameters, $route, $request, $response = null)
{
$data = array_merge([$route, $request, $response], $parameters);
return $this->events->until('router.filter: ' . $filter, $this->cleanFilterParameters($data));
}
示例7: fireSluggingEvent
/**
* Fire the namespaced validating event.
*
* @param \Illuminate\Database\Eloquent\Model $model
* @param string $event
* @return mixed
*/
protected function fireSluggingEvent(Model $model, $event)
{
return $this->events->until('eloquent.slugging: ' . get_class($model), [$model, $event]);
}