Sets editable callback.
@param callback $callback function($id, $newValue, $oldValue, Columns\Editable $column) {}
@return Editable
422861
public function setEditableCallback($callback)
    {
        $this->isEditable() ?: $this->setEditable();
        $this->editableCallback = $callback;

        return $this;
    }
431933
public function callback($callback)
    {
        $t = $this;
        $args = array_slice(func_get_args(),1);

        // use an event handler to dispatch to the callback
        $this->_events->register('startTransaction', function($event, $connection) use ($t, $callback, $args) {
            $t->results []= call_user_func_array($callback, $args);
        });

        return $this;
    }
56106
protected function makeAbilityCallback($callback)
    {
        return function ($component) use ($callback) {
            if (is_callable($callback)) {
                return $callback($component);
            }
            if (is_string($callback)) {
                list($class, $method) = Str::parseCallback($callback);

                return call_user_func([$this->app->make($class), $method], $component);
            }
        };
    }
195492
public function setCallback($callback)
    {
        // taken from http://www.geekality.net/2011/08/03/valid-javascript-identifier/
        $pattern = '/^[$_\p{L}][$_\p{L}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*+$/u';
        $parts = explode('.', $callback);

        foreach ($parts as $part)
        {
            if (!preg_match($pattern, $part)) {
                throw new InvalidArgumentException('The callback name is not valid.');
            }
        }

        $this->_padding = $callback;
    }
1046349
public function each(callable $callback): self
    {
        $index = 0;
        foreach ($this->items as $key => $value) {
            $callback($value, $key, $index++);
        }

        return $this;
    }
53992
public function setCallback(Closure $callback = null)
    {
        if ($this->callback !== null || $callback === null) {
            throw new \RuntimeException("Cannot redeclare this comparer callback.");
        }

        $this->callback = Closure::bind($callback, $this, get_called_class());
    }
217257
public function preprocess(callable $callback)
    {
        if ($callback instanceof Closure) {
            $callback = $callback->bindTo($this, get_class($this));
        }

        $this->getPreprocessor()->register($callback);
        return $this;
    }
1184438
public function setCallback($callback)
    {
        if($callback instanceof Closure)
        {
            $this->callback = $callback;
        }
        elseif(is_callable($callback))
        {
            $this->callback = function($chunk) use($callback)
            {
                return call_user_func_array($callback, [$chunk]);
            };
        }
        else
        {
            throw new Exception('Invalid callback');
        }

        return $this;
    }
167270
public function error(callable $callback)
    {
        if ($callback instanceof Closure) {
            $callback = $callback->bindTo($this, get_class($this));
        }

        $this->getErrorProcessor()->register($callback);
        return $this;
    }
780503
public function add_rule($callback)
	{
		$args = array_slice(func_get_args(), 1);
		$this->rules[] = array($callback, $args);

		// Set required setting for forms when rule was applied
		if ($callback === 'required')
		{
			$this->set_attribute('required', 'required');
		}

		return $this;
	}
320544
public function update(string $id, Closure $callback): self
    {
        if (str_contains($id, ',')) {
            collect(explode(',', $id))
                ->map('trim')
                ->each(function ($element) use ($callback) {
                    $this->update($element, $callback);
                });

            return $this;
        }

        $element = $this->find($id);

        if ($element && $callback) {
            $callback($element);
        }

        return $this;
    }
1250514
public function callback(string $name, callable $callback): self
    {
        $this->data->callback($name, $callback);
        return $this;
    }
781261
public function addIndex(string $id, callable $callback): self
    {
        $index = new MapIndex($callback);

        foreach ($this->elements as $key => $element) {
            $index->add($key, $element);
        }

        $this->indexes[$id] = $index;

        return $this;
    }
983241
public function setEditableRowCallback($callback)
    {
        $this->isEditable() ?: $this->setEditable();
        $this->editableRowCallback = $callback;

        return $this;
    }
250231
public function setUserCallback (callable $callback)
	{
		//$this->usercallback = $callback;

		if (count ($this->usercallback) > 0)
			throw new InvalidParameter ("A usercallback was already set. Use addUserCallback to add multiple callbacks");

		$this->addUserCallback ('default', $callback);

		return $this;
	}
900181
public function transform(callable $callback): self
    {
        $index = 0;
        foreach ($this->items as $key => $value) {
            $this->set($key, $callback($value, $key, $index++));
        }

        return $this;
    }
712786
public function each($callback)
    {
        Argument::i()->test(1, 'callable');

        foreach ($this->list as $key => $value) {
            call_user_func($callback, $key, $value);
        }

        return $this;
    }