Create new row and add in collection

@param string $pattern
@param string|\Closure $action
@param string|null $name
482835
public function post($pattern, $action, $name = null)
	{
		return $this->addRoute(['POST'], $pattern, $action, $name);
	}
256594
private function addRoute($method, $pattern, $action)
    {

        if (is_array($method)) {
            foreach ($method as $verb) {
                $this->routes[$verb . $pattern] = ['method' => $verb, 'uri' => self::patternFactory($pattern), 'action' => $action];
            }
        } else {
            $this->routes[$method . $pattern] = ['method' => $method, 'uri' => self::patternFactory($pattern), 'action' => $action];
        }
    }
1226114
public function match(array $methods, $pattern, $action)
    {
        $group = new Group;
        foreach ($methods as $method)
            $group->set($this->set($method, $pattern, $action));
        return $group;
    }
184404
public function addPattern(string $name, string $regexp)
    {
        $this->regexp_map = ['/\{(\w+):'.$name.'\}/' => '(?<$1>'.$regexp.')'] + $this->regexp_map;
    }
537087
public function put($pattern, $action)
    {
        self::$rules[self::REQUEST_METHOD_PUT . self::patternFactory($pattern)] = $action;
        return $this;
    }
1287165
public function get($pattern, $action)
    {
        self::$rules[self::REQUEST_METHOD_GET . self::patternFactory($pattern)] = $action;
        return $this;
    }
1336520
public function addListAction($name, array $action)
    {
        foreach ([
            'label' => $name,
            'params' => [],
            'translation_domain' => '',
            'action' => '',
            'route' => '',
        ] as $field => $value) {
            if (empty($action[$field])) {
                $action[$field] = $value;
            }
        }

        if (!$action['action'] && !$action['route']) {
            return $this;
        }

        $this->listActions[$name ? $name : $action['label']] = $action;

        return $this;
    }
337996
public function crud($pattern, $callback, array $params = [])
    {
        if (!is_string($callback)) {
            throw new \Exception('Crud callbacks must be a string to a controller class');
        }

        if (!empty($params['name'])) {
            $name = $params['name'];
        }

        $pattern  = rtrim($pattern, '/');
        $params['name'] = $name ? $name . '.create' : null;
        $this->post("{$pattern}", "{$callback}@create", $params);

        $params['name'] = $name ? $name . '.one' : null;
        $this->get("{$pattern}/(:any)", "{$callback}@one", $params);

        $params['name'] = $name ? $name . '.many' : null;
        $this->get("{$pattern}", "{$callback}@many", $params);

        $params['name'] = $name ? $name . '.update' : null;
        $this->put("{$pattern}/(:any)", "{$callback}@update", $params);

        $params['name'] = $name ? $name . '.delete' : null;
        $this->delete("{$pattern}/(:any)", "{$callback}@delete", $params);

        return $this;
    }
991725
public function any($pattern, $action, $name =  null)
    {
        return $this->addRoute(['*'], $pattern, $action, $name);
    }
910155
public function rest($pattern, $action)
    {
        is_array($action) ? $action['__rest'] = 1 : $action = ['__rest' => 0, '__action' => $action];
        $this->addRoute($this->httpMethod, $pattern, $action);
        return $this;
    }
1027347
public function addRoute($methods, string $pattern, string $handler)
    {
        if (is_string($methods)) {
            $methods = (array) $methods;
        }

        $methods = array_map('strtoupper', $methods);

        $this->routes[] = [
            $methods,
            $pattern,
            $handler
        ];
    }
1000449
protected function createAction($name, $actionTemplate, WorkflowDefinition $definition = null)
    {
        $type = $actionTemplate['type'];
        if (!$type || !class_exists($type)) {
            throw new Exception(_t(
                'WorkflowTemplate.INVALID_TEMPLATE_ACTION',
                'Invalid action class specified in template'
            ));
        }

        $action = $type::create();

        $action->Title = $name;

        if (isset($actionTemplate['properties']) && is_array($actionTemplate['properties'])) {
            foreach ($actionTemplate['properties'] as $prop => $val) {
                $action->$prop = $val;
            }
        }

        // Deal with User + Group many_many relations on an action
        $this->addManyManyToObject($action, $actionTemplate);

        if ($definition) {
            $action->WorkflowDefID = $definition->ID;
        }

        $action->write();

        return $action;
    }
732285
public function execute($row, $name = null)
    {
        parent::execute($row, $name);
        return $row[MemberNames::LINK_ID];
    }
1061186
public function any(string $name, ?string $pattern = null, array $options = []): RouteData
    {
        $groups = $this->groups;

        $route = new RouteData($name);

        $this->routes[implode('.', array_keys($groups)) . '@' . $name] = $route;

        $route->setOptions($options);

        if ($pattern) {
            $pattern = '/' . ltrim($pattern, '/');

            $route->pattern($pattern);
        }

        // Middlewares
        $middlewares = array_filter(array_column($groups, 'middlewares'), 'is_array');

        if ($middlewares !== []) {
            $middlewares = array_merge(...$middlewares);

            $route->middlewares($middlewares);
        }

        $route->groups($this->groups)
            ->package((string) $this->getOption('package'));

        return $route;
    }
590609
protected function addRoute($method, $pattern, $callback, array $middleware = null, $name = null)
    {
        $concatenatedPattern = (!is_null($this->prefix) ? '/' . $this->prefix : '') .
            $pattern;

        $this->collector->addRoute(strtoupper($method), $concatenatedPattern, new Route($callback, $middleware));

        if ($name !== null) {
            $this->namedRoutes[$name] = $concatenatedPattern;
        }
    }
590889
private function sanitizePattern($name, $pattern)
    {
        // make sure value is a string
        if (!$this->isString($pattern)) {
            throw new RouterException('The value of %s.%s option must be a string.', [
                    $this->name,
                    $name
                ]
            );
        }

        // filter out some characters from the start and end of the pattern
        $pattern = $this->str($pattern)->trimLeft('^')->trimRight('$');

        // make sure pattern is not empty
        if ($pattern->length() < 1) {
            throw new RouterException('The route for %s.%s cannot be empty.', [
                    $this->name,
                    $name
                ]
            );
        }

        return $pattern->val();
    }
1270254
public function profileMe($name, \Closure $action)
    {
        $this->startProfiling($name);
        $return = $action();
        $this->stopProfiling($name);

        return $return;
    }