load a modelCallBack rule into the store

@param \Closure $check
@param int $crud
172706
public function addModelCallbackRule(\Closure $check, $crud = DELETERULES)
    {
        // if an existing rule is detected, over write
        $this->rules[rand(1, 99999)] = new ModelCallbackRule($check, $crud);
    }
48791
public function addCheck(Check $check)
    {
        if ($this->hasCheck($check->getName())) {
            throw SchemaException::tableCheckAlreadyExists($this->getName(), $check->getName());
        }

        $this->checks[$check->getName()] = $check;
    }
989861
protected function module($check = null) {
        $module = Util::camelToHyphen($this->view->getModule());
        return $check ? ($check == $module) : $module;
    }
669798
public function runCallback( \Closure $callback, $postReinitialize = true )
    {
        $this->requestInit();

        try
        {
            $return = $callback();
        }
        catch ( Exception $e )
        {
            $this->shutdown( $postReinitialize );
            throw $e;
        }

        $this->shutdown( $postReinitialize );

        return $return;
    }
522746
public function _loadValidation($reload= false) {
        if (!$this->_validationLoaded || $reload == true) {
            $validation= $this->xpdo->getValidationRules($this->_class);
            $this->_validationLoaded= true;
            foreach ($validation as $column => $rules) {
                foreach ($rules as $name => $rule) {
                    $parameters = array_diff($rule, array($rule['type'], $rule['rule']));
                    $this->addValidationRule($column, $name, $rule['type'], $rule['rule'], $parameters);
                }
            }
        }
    }
380959
protected function check($name, $check = '')
    {
        if (!isset($this->keyMap[$name])) {
            return false;
        }
        return ($this->keyMap[$name]['checksum'] === $this->generateNewChecksum($check));
    }
240065
public function table($table, Closure $callback)
    {
        $blueprint = $this->createBlueprint($table);

        $callback($blueprint);

        foreach ($blueprint->getCommands() as $command) {
            if ($command->get('name') == 'drop') {
                $this->helper->dropAutoIncrementObjects($table);
            }
        }

        $this->build($blueprint);

        $this->comment->setComments($blueprint);
    }
311859
public function update($table, Closure $closure)
    {
        $blueprint = $this->createBlueprint($table, $closure);
        $blueprint->update();
    }
442984
public function create($collection, Closure $callback = null)
    {
        $blueprint = $this->createBlueprint($collection);
        $blueprint->create();
        sleep(10);
        if ($callback) {
            $callback($blueprint);
        }
    }
331994
protected function params($check = null) {
        $params = $this->view->getParams();
        if ($check) {
            if (is_array($check)) {
                $inter = array_intersect($check, $params);
                return (count($inter) === count($check));
            }
            else {
                return in_array($check, $params);
            }
        }
        return $params;
    }
470805
public function loadDataContainerHook($table)
	{
		if (TL_MODE !== 'BE') {
			return;
		}

		if (defined('TL_REFERER_ID') && \Input::get('ref')) {
			$this->removeRsfhrParam(\Input::get('ref'));
		}

		// Only handle requests from the frontend helper
		if (!\Input::get('rsfhr')) {
			return;
		}

		if ($table === 'tl_templates') {
			$this->handleTemplateSelection();
		}

		$this->storeFrontendReferrer();
	}
1097117
protected function onInvalidEventCustomValidity($key, $check = [])
    {
        $this->vMethodMessages .= $this->setCustomValidity($key, $check) . ' ';

        return $this;
    }
116297
public function read($id, array $options = [], Closure $callback = null) {
        return $this->select()
            ->where($this->getPrimaryKey(), $id)
            ->bindCallback($callback)
            ->first($options);
    }
514228
protected function afterResolvingCallback(Closure $callback)
    {
        $abstract = $this->getFunctionHint($callback);

        if ($abstract) {
            $this->afterResolvingCallbacks[$abstract][] = $callback;
        } else {
            $this->globalAfterResolvingCallbacks[] = $callback;
        }
    }
479566
protected function _cache($key, Closure $callback) {
        if (isset($this->_cache[$key])) {
            return $this->_cache[$key];
        }

        // Requires 5.4
        // Closure::bind($callback, $this, __CLASS__);

        $this->_cache[$key] = $callback($this);

        return $this->_cache[$key];
    }
1253531
public function callback(Closure $callback)
    {
        foreach ($this->getInnerIterator() as $key => $value) {
            yield $callback($value, $key);
        }
    }
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);
    }