Nestable\Services\NestableService::hasChild PHP Метод

hasChild() публичный Метод

Child menu checker.
public hasChild ( string $key = null, mixed $value = null, Collection $data = null ) : boolean
$key string
$value mixed
$data Illuminate\Support\Collection Illuminate\Support\Collection as Collect
Результат boolean
    public function hasChild($key = null, $value = null, Collect $data = null)
    {
        if (count(func_num_args()) < 3) {
            $data = $this->data;
            $key = $this->parent;
            $value = current(func_get_args());
        }
        $child = false;
        $data->each(function ($item) use(&$child, $key, $value) {
            if (intval($item[$key]) == intval($value) && !$child) {
                $child = true;
            }
        });
        return $child;
    }