Parses the name for any aggregate functions and stores them in the $aggregate array

@param string $name
968379
protected function addAggregate($name)
    {
        if (!$this->relation) {
            return;
        }

        if (!preg_match('/([A-Za-z]+)\(\s*(?:([A-Za-z_*][A-Za-z0-9_]*))?\s*\)$/', $name, $matches)) {
            if (stristr($name, '(') !== false) {
                throw new InvalidArgumentException(sprintf(
                    'Malformed aggregate filter %s',
                    $name
                ));
            }
            return;
        }

        $this->aggregate = [
            'function' => strtoupper($matches[1]),
            'column' => isset($matches[2]) ? $matches[2] : null
        ];
    }
1105939
protected function _getTemplateName($name, array &$data = []) {
        if (isset($this->_callbacks[$name])) {
            $data = call_user_func($this->_callbacks[$name], $data);
        }
        if ($this->_callback) {
            $data = call_user_func($this->_callback, $name, $data);
        }
        if (isset($data['templateName'])) {
            $name = $data['templateName'];
            unset($data['templateName']);
        }
        return $name;
    }
230574
protected function parseName($name) {
        $tableName = $name;
        $suffix = NULL;

        $pos = strrpos($name, '_');
        if ($pos !== FALSE) {
            $tableId = substr($name, $pos + 1);
            if (is_numeric($tableId)) {
                $tableName = substr($name, 0, $pos);
                $suffix = intval($tableId);
            }
        }

        return array($tableName, $suffix);
    }
892367
function ByName($name)
    {
        $this->CheckData($name);
        if ($this->row)
            return $this->row[(string)$name];
    }
49847
public function setName($name) {
    /** @var TokenNode $function_name */
    $function_name = $this->getName()->firstChild();
    $function_name->setText($name);
    return $this;
  }
1209330
private static function parseTableName($name)
    {
        // Init buffer
        $buffer = '';
        $strOpen = false;
        $names = array();

        $strLen = strlen($name);
        for($i = 0; $i < $strLen; $i++)
        {
            if($name[$i] == '"')
            {
                // Toggle strings
                if( !$strOpen || ($strOpen && $name[$i - 1] != "\\") )
                {
                    $strOpen = !$strOpen;
                }
            }
            elseif($name[$i] == '.' && !$strOpen)
            {
                // Save and cleanup buffer. Continue.
                $names[] = $buffer;
                $buffer = '';
                continue;
            }

            // Store char
            $buffer .= $name[$i];
        }

        // Save last buffer
        if($buffer != '') {
            $names[] = $buffer;
        }

        return $names;
    }
1155589
private function parseReferences($name): string
    {
        if (preg_match_all('/\$\{(.*[a-z\.0-9])\}/si', $name, $results, PREG_SET_ORDER)) {
            foreach ($results as $match) {
                $replace = $match[0];
                $key = $match[1];

                // Handle using relative placement like get('db.${.default}.host');
                if (strpos($key, '.') === 0) {
                    // using relative placement
                    $key = substr($name, 0, strpos($name, $replace) - 1) . $key;
                }

                // get the value
                $value = $this->get($key);
                if ($value === null || $value === '' || $value === false) {
                    throw new InvalidArgumentException(
                        $key . ' replacement for ' . $name . ' must not be null or empty'
                    );
                }

                $name = str_replace($replace, $value, $name);
            }
        }

        return $name;
    }
149294
protected function parseMigrationName($name)
    {
        // create_users_table
        // add_user_id_to_posts_table
        // create_post_tag_table
        $pieces = explode('_', $name);

        // This is the action that the user
        // wants to take. Create or Delete or Add.
        $action = array_shift($pieces);

        // Adding _table to the migration name is optional
        if (end($pieces) == 'table') array_pop($pieces);

        // Next, we need to determine what the table name is.
        // This is tough, because it could be something like
        // posts, or posts_tags. Further, the migration name could
        // be 'create_posts_tags_table', or 'add_post_id_to_posts_tags_table'
        // So we'll search for the keywords 'to' or 'from'.
        $divider = array_search('to', $pieces);
        if ($divider === false) $divider = array_search('from', $pieces);

        // If we did find one of those "to" or "from" connecting words,
        // we know that what follows is the table name.
        $tableName = ($divider !== false)
            ? implode('_', array_slice($pieces, $divider + 1))
            : implode('_', $pieces);

        // For example: ['add', 'posts']
        return array($action, $tableName);
    }
648104
public function setBlockName($name)
    {
        if (!StringHelper::endsWith($name, 'Block')) {
            $name .= 'Block';
        }
        
        $this->_blockName = Inflector::camelize($name);
    }
329917
protected function string(string $name): Closure
    {
        return function (Table $table, MigrationContextInterface $context) use ($name) {
            $length = $context->getModelSchemas()->getAttributeLength($context->getModelClass(), $name);
            $table->addColumn($name, Type::STRING)->setLength($length)->setNotnull(true);
        };
    }
1298651
public static function get($name)
	{
		$args = func_get_args();
		if (!empty($args))
		{
			unset($args[0]);
		}
		if (isset(self::$list[$name]))
		{
			array_unshift($args, self::$list[$name]);
			return call_user_func_array('sprintf', $args);
		}
		else
		{
			return $name;
		}
	}
295167
protected function checkForReservedClassName($name)
    {
        $name = trim(strtolower($name));

        if (in_array($name, config('pxlcms.generator.reserved', []))) {
            throw new \InvalidArgumentException("Cannot use {$name} as a module name, it is reserved!");
        }
    }
297791
public function encode($name) {
		$aliases = $this->aliases;
		if(empty($aliases)) {
			return $name;
		}
		return $this->aggregate($name, $aliases);
	}
99384
public function getValidationErrorsByName($name)
    {
        $errors = [];

        if ($this->name == $name) {
            $errors[] = $this;
        }

        $errors = array_merge($errors, $this->getValidationErrorsByNameRecursive($name, $this->subErrors));

        return $errors;
    }
925770
protected function _parseName($name)
    {
        $result = [];
        $parts = preg_split('~([^\\\]*\\\?)~', $name, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);

        $last = array_pop($parts);

        if (!$last) {
            return [];
        }

        foreach ($parts as $name) {
            $result[] = [$name, 'namespace'];
        }

        if (strpos($last, '::') !== false) {
            list($name, $subname) = explode('::', $last, 2);
            $result[] = [$name, 'class'];
            $result[] = [$subname, 'method'];
        } elseif (preg_match('~\(\)$~', $last)) {
            $result[] = [$last, 'function'];
        } else {
            $result[] = [$last, substr($last, -1) === '\\' ? 'namespace' : 'class'];
        }
        return $result;
    }
571436
public static function parsePredict(string $name):array
    {
        $f = ComManager::getFileCommand();
        $meaning = [];
        if ($f == null) {
            throw new Server500(new \ArrayObject(array("explain" =>
                "Framework Predictions Error : Command File is empty",
                "solution" => "Command file cannot not be empty")));
        }
        $commands = $f->commands;

        foreach ($commands as $command => $val) {
            if ($val->type === "single") {
                if (stristr($command, $name) != false) {
                    $meaning[] = $commands;
                }
            } elseif ($val->type === "multiple") {
                foreach ($val->args as $acommand => $aval) {
                    if (stristr($aval->name, $name) != false) {
                        $meaning[] = $aval->name;
                    }
                }
            }
        }
        return ($meaning);
    }
1038727
public function getAggregation($name)
    {
        $aggregations = $this->getAggregations();
        if (!isset($aggregations[$name])) {
            throw new InvalidCallException("Aggregation '{$name}' does not present.");
        }
        return $aggregations[$name];
    }