src/Controller/AdminControllerTrait.php
protected function executeDynamicMethod($methodNamePattern, array $arguments = [])
    {
        $methodName = \str_replace('<EntityName>', $this->entity['name'], $methodNamePattern);

        if (!\is_callable([$this, $methodName])) {
            $methodName = \str_replace('<EntityName>', '', $methodNamePattern);
        }

        return \call_user_func_array([$this, $methodName], $arguments);
    }
protected function executeDynamicMethod($methodNamePattern, array $arguments = [])
    {
        $methodName = \str_replace('<EntityName>', $this->entity['name'], $methodNamePattern);

        if (!\is_callable([$this, $methodName])) {
            $methodName = \str_replace('<EntityName>', '', $methodNamePattern);
        }

        return \call_user_func_array([$this, $methodName], $arguments);
    }
Given a method name pattern, it looks for the customized version of that
method (based on the entity name) and executes it. If the custom method
does not exist, it executes the regular method.

For example:
executeDynamicMethod('create<EntityName>Entity') and the entity name is 'User'
if 'createUserEntity()' exists, execute it; otherwise execute 'createEntity()'

@param string $methodNamePattern The pattern of the method name (dynamic parts are enclosed with <> angle brackets)
@param array  $arguments         The arguments passed to the executed method

@return mixed