src/Database/Scope/Scope.php
public function onceTo($scope, callable $callback)
    {
        $mainScope = $this->scope;

        $this->scope = $scope;

        $result = $callback();

        $this->scope = $mainScope;

        return $result;
    }
public function onceTo($scope, callable $callback)
    {
        $mainScope = $this->scope;

        $this->scope = $scope;

        $result = $callback();

        $this->scope = $mainScope;

        return $result;
    }
public function onceTo ( $ scope , callable $ callback ) { $ mainScope = $ this -> scope ; $ this -> scope = $ scope ; $ result = $ callback ( ) ; $ this -> scope = $ mainScope ; return $ result ; }
Run the given callback with the given temporary scope.

@param  mixed   $scope
@param  callable  $callback
@return mixed
Run the given callback with the given temporary scope .