Generate the name column.

@param \stdClass $tool event data.
@return string
341710
public function col_name($tool) {
        $name = helper::get_name($tool);

        return $this->get_display_text($tool, $name);
    }
211991
protected function generateClassName($tableName)
    {
        if (isset($this->_classNames[$tableName])) {
            return $this->_classNames[$tableName];
        }

        if (($pos = strrpos($tableName, '.')) !== false) {
            $tableName = substr($tableName, $pos + 1);
        }

        $db = $this->getDbConnection();
        $patterns = [];
        $patterns[] = "/^{$db->tablePrefix}(.*?)$/";
        $patterns[] = "/^(.*?){$db->tablePrefix}$/";
        if (strpos($this->tableName, '*') !== false) {
            $pattern = $this->tableName;
            if (($pos = strrpos($pattern, '.')) !== false) {
                $pattern = substr($pattern, $pos + 1);
            }
            $patterns[] = '/^' . str_replace('*', '(\w+)', $pattern) . '$/';
        }
        $className = $tableName;
        foreach ($patterns as $pattern) {
            if (preg_match($pattern, $tableName, $matches)) {
                $className = $matches[1];
                break;
            }
        }

        return $this->_classNames[$tableName] = Inflector::id2camel($className, '_');
    }
995425
public function get_section_name($section) {
        $section = $this->get_section($section);
        if ((string)$section->name !== '') {
            // Return the name the user set.
            return format_string($section->name, true, array('context' => context_course::instance($this->courseid)));
        } else {
            return $this->get_default_section_name($section);
        }
    }
852516
public function classNameForEvent($event): string
    {
        if ( ! isset($this->eventClasses[$event])) {
            throw new \InvalidArgumentException("Could not find a class for the event {$event}.");
        }
        return $this->eventClasses[$event];
    }
1176851
protected function create_name() {
		$format  = '%s';
		$format .= str_repeat( '[%s]', ( count( $this->args->keys ) - 1 ) );

		return $this->create_id_name( $format );
	}
994141
public function generateIndexName($columns)
    {
        $parts = [];
        foreach ($columns as $column => $order) {
            $parts[] = $column . '_' . $order;
        }
        return implode('_', $parts);
    }
948475
private function prepareModelName($sModelName): \stdClass
    {
        //  Prepare the supplied model name and test
        $sModelName = preg_replace('/[^a-zA-Z\/ ]/', '', $sModelName);
        $sModelName = preg_replace('/\//', ' \\ ', $sModelName);
        $sModelName = ucwords($sModelName);

        //  Prepare the database table name
        $sTableName = preg_replace('/[^a-z ]/', '', strtolower($sModelName));
        $sTableName = preg_replace('/ +/', '_', $sTableName);
        if (defined('APP_DB_PREFIX')) {
            $sTableNameWithPrefix = APP_DB_PREFIX . $sTableName;
        } else {
            $sTableNameWithPrefix = $sTableName;
        }

        //  Prepare the model name, namespace, filename etc
        $sModelName = 'App\Model\\' . preg_replace('/ /', '', $sModelName);
        $aModelName = explode('\\', $sModelName);
        $aNamespace = array_splice($aModelName, 0, -1);
        $sClassName = implode('', $aModelName);
        $sFilename  = $sClassName . '.php';
        $sPath      = static::MODEL_PATH . implode(DIRECTORY_SEPARATOR, array_slice($aNamespace, 2));
        $sPath      = substr($sPath, -1) !== DIRECTORY_SEPARATOR ? $sPath . DIRECTORY_SEPARATOR : $sPath;
        $sNamespace = implode('\\', $aNamespace);

        //  Set the service name
        $sServiceName = str_replace('App\Model\\', '', $sModelName);
        $sServiceName = str_replace('\\', '', $sServiceName);

        //  Set resource details
        $sResourceNamespace = preg_replace('/^App\\\\Model/', 'App\\Resource', $sNamespace);
        $sResourceClassName = $sClassName;
        $sResourcePath      = static::MODEL_RESOURCE_PATH . implode(DIRECTORY_SEPARATOR, array_slice($aNamespace, 2));
        $sResourcePath      = substr($sResourcePath, -1) !== DIRECTORY_SEPARATOR ? $sResourcePath . DIRECTORY_SEPARATOR : $sResourcePath;
        $sResourceFilename  = $sFilename;


        return (object) [
            'namespace'           => $sNamespace,
            'class_name'          => $sClassName,
            'class_path'          => $sNamespace . '\\' . $sClassName,
            'path'                => $sPath,
            'filename'            => $sFilename,
            'table'               => $sTableName,
            'table_with_prefix'   => $sTableNameWithPrefix,
            'service_name'        => $sServiceName,
            'resource_namespace'  => $sResourceNamespace,
            'resource_class_name' => $sResourceClassName,
            'resource_class_path' => $sResourceNamespace . '\\' . $sResourceClassName,
            'resource_path'       => $sResourcePath,
            'resource_filename'   => $sResourceFilename,
        ];
    }
847826
public function col_launch($tool) {
        global $OUTPUT;

        $url = helper::get_cartridge_url($tool);

        $cartridgeurllabel = get_string('cartridgeurl', 'enrol_lti');
        $cartridgeurl = $url;
        $secretlabel = get_string('secret', 'enrol_lti');
        $secret = $tool->secret;
        $launchurl = helper::get_launch_url($tool->id);
        $launchurllabel = get_string('launchurl', 'enrol_lti');

        $data = [
                "rows" => [
                    [ "label" => $cartridgeurllabel, "text" => $cartridgeurl, "id" => "cartridgeurl", "hidelabel" => false ],
                    [ "label" => $secretlabel, "text" => $secret, "id" => "secret", "hidelabel" => false ],
                    [ "label" => $launchurllabel, "text" => $launchurl, "id" => "launchurl", "hidelabel" => false ],
                ]
            ];

        $return = $OUTPUT->render_from_template("enrol_lti/copy_grid", $data);

        return $return;
    }
1344609
protected function commandNameToEventName($command)
	{
		$commandName = class_basename($command);
		if(ends_with($commandName, 'Command'))
		{
			$commandName = substr($commandName, 0, strpos($commandName, 'Command'));
		}

		$commandName = snake_case($commandName);
		$parts = explode('_', $commandName);
		$eventName = implode('.', $parts);

		return $eventName;
	}
624718
private function getStdSeparatedName()
	{
		if ($this->schema && $this->getBuildProperty('schemaAutoPrefix')) {
			return $this->schema . NameGenerator::STD_SEPARATOR_CHAR . $this->getCommonName();
		} else {
			return $this->getCommonName();
		}
	}
820230
protected function getFieldName($alias)
    {
        $name = $this->getOption('field');

        if ($this->getOption('auto_alias') && !preg_match('/\./', $name)) {
            $name = "$alias.$name";
        }

        return $name;
    }
856230
public function column(string $name): string
    {
        $name = \addcslashes($name, "'");
        $table = $this->getMetadata()->getTableName();

        return \sprintf("FIELD('%s', '%s', '%s')", $table, $this->getAlias(), $name);
    }
541072
public function prepareName($name)
    {
        $name = empty($name) ? 'index' : $name;
        $name = strtolower($name);
        $name = str_replace(['-', '_'], ' ', $name);
        $name = ucwords($name);
        $name = str_replace(' ', '', $name);
        
        return $name;
    }
700831
public function getIdentifiersName()
    {
        $name = $this->tableName . '[' . static::IDENTIFIERS . ']';

        if ($this->selectionMode == Config::SELECTION_MULTIPLE) {
            $name .= '[]';
        }

        return $name;
    }
886768
protected function _referenceName()
    {
        $table = $this->_table;
        $name = namespaceSplit(get_class($table));
        $name = substr(end($name), 0, -5);
        if (empty($name)) {
            $name = $table->getTable() ?: $table->getAlias();
            $name = Inflector::camelize($name);
        }

        return $name;
    }
772643
function GetDescriptorName($remove_prefix = true)
	{
		foreach ($this->Columns as $column)
		{
			if ($column->Type == "varchar")
			{
				return ($remove_prefix) ? $this->RemovePrefix($column->Name) : $column->Name;
			}
		}

		// give up because there are no varchars in this table
		return $this->GetPrimaryKeyName($remove_prefix);
	}
1052100
public function getName()
    {
        $name = $this->name ?? Str::snake(str_replace('IndexConfigurator', '', class_basename($this)));

        return config('scout.prefix').$name;
    }