[Internal] : Assigns or retrieve the Save callback
The save callback interface is
function($table, array $options)

@param  callable $callback The callback to use on model save
@return callable           Current save callback
320690
private static function relationAddRelationshipTo($link, $plurality, $extra=[]){
    $options = static::relationOptions();

    preg_match('((?<FOREIGN_CLASS>\w+)(\.(?<FOREIGN_KEY>\w+))?(:(?<LOCAL_KEY>\w+))?)', $link, $parts);

    $foreign_class = isset($parts['FOREIGN_CLASS']) ? $parts['FOREIGN_CLASS'] : false;
    $foreign_key   = isset($parts['FOREIGN_KEY'])   ? $parts['FOREIGN_KEY']   : false;
    $local_key     = isset($parts['LOCAL_KEY'])     ? $parts['LOCAL_KEY']     : false;

    if ( ! $foreign_class )
       throw new Exception("[Core.Relation] Class ".get_called_class()." must define a foreign Model when assigning a relation.", 1);

    if ( ! is_subclass_of($foreign_class,"Model") )
       throw new Exception("[Core.Relation] Class ".get_called_class()." want to relate to $foreign_class but it's not a Model.", 1);

    if ( ! $foreign_key ) {
      // Retrieve primary key from foreign class
      $foreign_key = $foreign_class::persistenceOptions("key");
    }

    if ( ! $local_key ) {
      // Retrieve local primary key
      $local_key = static::persistenceOptions("key");
    }

    $single = $plurality == 'single';

    $method = preg_replace_callback('([A-Z])', function($m){
      return "_" . strtolower($m[0]);
    }, lcfirst($foreign_class) . ($single ? '' : 's'));

    $hh = [$foreign_class,$foreign_key,$local_key];
    sort($hh);
    $options->links[md5(serialize($hh))] = $rel = (object)[
      'foreign_class' =>  $foreign_class,
      'foreign_key'   =>  $foreign_key,
      'local_key'     =>  $local_key,
      'single'        =>  $single,
      'method'        =>  $method,
      'extra'         =>  (object) $extra,
    ];

    if (empty($options->relations)) $options->relations = (object)[];
    $options->relations->$method = $getset = (object)[
      'get' => function($self) use ($foreign_class, $rel) {
         $val = $self->{$rel->local_key};
         $val = is_numeric($val) ? $val : "'" . addslashes($val) . "'";
         $data = $foreign_class::where("{$rel->foreign_key} = {$val}");
         return $rel->single ? current($data) : $data;
      },
      'set' => function($value, $self) use ($foreign_class, $rel) {
        if (!is_a($value, $foreign_class))
          throw new Exception("[Core.Relation] Relationship for {$rel->method} must be of class $foreign_class.", 1);
        $self->local_key = $value->foreign_key;
        return $value;
      },
    ];

  }
1059542
public function table($table, Closure $callback)
    {
    	if(!$this->hasTable($table)) {
    		return hst_message('is has table');
    	}
        \Schema::connection($this->databaseName)->table($table, $callback);
    }
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;
	}
1110130
public function map(callable $callback = null)
	{
		return $callback ? array_map($callback, $this->list) : $this->list;
	}
125844
public function table($table, Closure $callback)
    {
        $this->build($this->createBlueprint($table, $callback));
    }
217086
public function transactional(callable $callback)
    {
        $this->begin();

        try {
            $result = $callback($this);
        } catch (Exception $e) {
            $this->rollback(false);
            throw $e;
        }

        if ($result === false) {
            $this->rollback(false);

            return false;
        }

        try {
            $this->commit();
        } catch (NestedTransactionRollbackException $e) {
            $this->rollback(false);
            throw $e;
        }

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

        $this->getPostprocessor()->register($callback);
        return $this;
    }
580643
public function setCallback($callback)
    {
        if (!$callback instanceof Closure) {
            throw new Exception\InvalidArgumentException(sprintf(
                'Invalid parameter for callback: must be %s',
                Closure::class
            ));
        }

        return parent::setCallback($callback);
    }
940022
public function bind(string $name, callable $callback): self
    {
        $this->data->bind($name, $callback);
        return $this;
    }
695451
public function create($table, Closure $callback)
    {
        $blueprint = $this->createBlueprint($table);

        $blueprint->create();

        $callback($blueprint);

        $this->build($blueprint);

        $this->comment->setComments($blueprint);

        $this->helper->createAutoIncrementObjects($blueprint, $table);
    }
2580
public function sort(callable $callback = null) : Stack
    {
        $values = $this->_sort($callback);
        $this->setValues($values);
        return $this;
    }
935359
public static function callback(callable $callback) : callable
    {
        return function (Message $message) use ($callback) {
            if ($message->getMessage()) {
                $return = Envelope::unserialize($message->getMessage());
                $return->headers['history'][] = new EnvelopeHistory($message->getWorkerId());

                return $callback($message, $return);
            } else {
                return $callback($message);
            }
        };
    }
1235416
public function computed(callable $callback) : ComputedComponentDefiner
    {
        return new ComputedComponentDefiner(function (IColumnComponent $chartAxisComponent, array $columnsToLoad) use ($callback) {
            $this->chartComponentCallableMap[$chartAxisComponent] = $callback;

            foreach ($columnsToLoad as $columnToLoad) {
                $column = $this->tableDataSource->getStructure()->getColumn($columnToLoad);
                $this->addColumnToLoad($column);
            }
        });
    }
618984
public function setCallback($callback){
		if(!is_callable($callback))
			throw new Exception('Invalid callback passed for logging: '.$callback);
		$this->callback = $callback;
		return $this;
	}
1281874
public function setCallback($callback)
    {
        if (!is_callable($callback)) {
            throw new InvalidArgumentException('Expected a callable. Got an uncallable '. gettype($callback));
        }

        $this->callback = $callback;

        return $this;
    }
138512
protected function callback($callback, array $args = [])
    {
        if (isset($callback)) {
            if (is_callable($callback) && $callback instanceof \Closure) {
                // Set new object and append the callback with some data.
                $o = new \ArrayObject($args);
                $o->app = App::instance();
                $callback = $callback->bindTo($o);
            } elseif (is_string($callback) && strpos($callback, '@') !== false) {
                $fixcallback = explode('@', $callback, 2);
                $this->Controller = $fixcallback[0];

                if (is_callable(
                    $callback = [$fixcallback[0], (isset($fixcallback[1]) ? $fixcallback[1] : 'index')]
                )) {
                    $this->Method = $callback[1];
                } else {
                    throw new \Exception("Callable error on {$callback[0]} -> {$callback[1]} !");
                }
            }

            if (is_array($callback) && !is_object($callback[0])) {
                $callback[0] = new $callback[0];
            }

            if (isset($args[0]) && $args[0] == $this->fullArg) {
                array_shift($args);
            }

            // Finally, call the method.
            return call_user_func_array($callback, $args);
        }
        return false;
    }
181784
public function resetCallBack(callable $callBack = null)
    {
        $this->callBack = null;
        $this->callBack = $callBack;
        return $this;
    }