Returns a unique StringColumn identifying this record in the user table.

@throws Exceptions\TokenException
@return StringColumn
327134
private function getSavedPasswordTokenData()
    {
        if ($this->isNewRecord()) {
            // We can't fulfil the request as we have no UserID which is required for the StringColumn.
            throw new TokenException("The user has not been saved");
        }

        return sha1($this->Username . $this->Password . $this->FullName . $this->Enabled . $this->UserID);
    }
352090
public function asCharacterString(): Primitive\CharacterString
    {
        if (!$this->_element instanceof Primitive\CharacterString) {
            throw new \UnexpectedValueException(
                $this->_generateExceptionMessage(Element::TYPE_CHARACTER_STRING));
        }
        return $this->_element;
    }
485958
public function unique($table, $col, $size, $withSpecialCharacters = false)
    {
        do {
            $token = $this->random($size, $withSpecialCharacters);

            $exists = DB::table($table)->where($col, $token)->exists();
        } while ($exists);

        return $token;
    }
1294310
public function createToken()
    {
        return $this->generator->generateString($this->tokenBytes, $this->formatMap[$this->tokenFormat]);
    }
1208658
public function getColumns()
    {
        $rawColumns = substr($this->data, 64, 128);
        $columnsString = rtrim($rawColumns, "\0");
        return explode("\0", $columnsString);
    }
636941
public function getColumn() : ?string 
    {
        if ( ! $this->hasColumn()) {
            $this->setColumn($this->getDefaultColumn());
        }
        return $this->column;
    }
1042262
public function toString()
    {
        if (!$this->_parts['table']) {
            throw new SqlException("Invalid `UPDATE` statement, missing `TABLE` clause.");
        }

        if (!$this->_parts['values']) {
            throw new SqlException("Invalid `UPDATE` statement, missing `VALUES` clause.");
        }

        return 'UPDATE' .
            $this->_buildFlags($this->_parts['flags']) .
            $this->_buildChunk($this->dialect()->names($this->_parts['table'])) .
            $this->_buildSet() .
            $this->_buildClause('WHERE', $this->dialect()->conditions($this->_parts['where'], [
                'schemas' => ['' => $this->_schema]
            ])) .
            $this->_buildOrder() .
            $this->_buildClause('LIMIT', $this->_parts['limit']) .
            $this->_buildClause('RETURNING', $this->dialect()->names($this->_parts['returning']));
    }
666405
public function getName()
    {
        if ($this->indexName === null) {
            try {
                // generate an index name if we don't have a supplied one
                $this->createName();
            } catch (EngineException $e) {
                // still no name
            }
        }
        if ($database = $this->getTable()->getDatabase()) {
            return substr($this->indexName, 0, $database->getPlatform()->getMaxColumnNameLength());
        } else {
            return $this->indexName;
        }
    }
298731
protected function getSelectColumnsSQL()
    {
        // Create the column list fragment only once
        if ($this->currentPersisterContext->selectColumnListSql !== null) {
            return $this->currentPersisterContext->selectColumnListSql;
        }

        $columnList         = array();
        $discrColumn        = $this->class->discriminatorColumn['name'];
        $baseTableAlias     = $this->getSQLTableAlias($this->class->name);
        $resultColumnName   = $this->platform->getSQLResultCasing($discrColumn);

        $this->currentPersisterContext->rsm->addEntityResult($this->class->name, 'r');
        $this->currentPersisterContext->rsm->setDiscriminatorColumn('r', $resultColumnName);
        $this->currentPersisterContext->rsm->addMetaResult('r', $resultColumnName, $discrColumn);

        // Add regular columns
        foreach ($this->class->fieldMappings as $fieldName => $mapping) {
            $class = isset($mapping['inherited'])
                ? $this->em->getClassMetadata($mapping['inherited'])
                : $this->class;

            $columnList[] = $this->getSelectColumnSQL($fieldName, $class);
        }

        // Add foreign key columns
        foreach ($this->class->associationMappings as $mapping) {
            if ( ! $mapping['isOwningSide'] || ! ($mapping['type'] & ClassMetadata::TO_ONE)) {
                continue;
            }

            $tableAlias = isset($mapping['inherited'])
                ? $this->getSQLTableAlias($mapping['inherited'])
                : $baseTableAlias;

            foreach ($mapping['targetToSourceKeyColumns'] as $srcColumn) {
                $className = isset($mapping['inherited'])
                    ? $mapping['inherited']
                    : $this->class->name;

                $targetClass = $this->em->getClassMetadata($mapping['targetEntity']);

                $columnList[] = $this->getSelectJoinColumnSQL(
                    $tableAlias,
                    $srcColumn,
                    $className,
                    PersisterHelper::getTypeOfColumn(
                        $mapping['sourceToTargetKeyColumns'][$srcColumn],
                        $targetClass,
                        $this->em
                    )
                );
            }
        }

        // Add discriminator column (DO NOT ALIAS, see AbstractEntityInheritancePersister#processSQLResult).
        $tableAlias = ($this->class->rootEntityName == $this->class->name)
            ? $baseTableAlias
            : $this->getSQLTableAlias($this->class->rootEntityName);

        $columnList[] = $tableAlias . '.' . $discrColumn;

        // sub tables
        foreach ($this->class->subClasses as $subClassName) {
            $subClass   = $this->em->getClassMetadata($subClassName);
            $tableAlias = $this->getSQLTableAlias($subClassName);

            // Add subclass columns
            foreach ($subClass->fieldMappings as $fieldName => $mapping) {
                if (isset($mapping['inherited'])) {
                    continue;
                }

                $columnList[] = $this->getSelectColumnSQL($fieldName, $subClass);
            }

            // Add join columns (foreign keys)
            foreach ($subClass->associationMappings as $mapping) {
                if ( ! $mapping['isOwningSide']
                        || ! ($mapping['type'] & ClassMetadata::TO_ONE)
                        || isset($mapping['inherited'])) {
                    continue;
                }

                foreach ($mapping['targetToSourceKeyColumns'] as $srcColumn) {
                    $className = isset($mapping['inherited'])
                        ? $mapping['inherited']
                        : $subClass->name;

                    $targetClass = $this->em->getClassMetadata($mapping['targetEntity']);

                    $columnList[] = $this->getSelectJoinColumnSQL(
                        $tableAlias,
                        $srcColumn,
                        $className,
                        PersisterHelper::getTypeOfColumn(
                            $mapping['sourceToTargetKeyColumns'][$srcColumn],
                            $targetClass,
                            $this->em
                        )
                    );
                }
            }
        }

        $this->currentPersisterContext->selectColumnListSql = implode(', ', $columnList);

        return $this->currentPersisterContext->selectColumnListSql;
    }
965015
public function getColumns()
    {
        $columns = array();
        foreach ($this->getRows() as $row) {
            $columns = array_merge($columns, $row->getColumns());
        }
        return array_unique($columns);
    }
1278112
public function getToken() : string {
        if (($this->token === null) || ($this->token->isExpired())) {
            $jwtBuilder = new Builder();
            $jwtBuilder->set('iss', $this->credentialPublicKey);
            $jwtBuilder->set('sub', $this->userName);

            $this->token = $jwtBuilder
                ->sign(new Sha256(), $this->credentialPrivateKey)
                ->getToken();
        }

        return (string) $this->token;
    }
880116
public function getColumnOffset() {
        // strrpos is weird, and the offset needs to be negative for what we
        // want (i.e., the last \n before $this->char). This needs to not have
        // one (to make it point to the next character, the one we want the
        // position of) added to it because strrpos's behaviour includes the
        // final offset byte.
        $lastLine = strrpos($this->data, "\n", $this->char - 1 - strlen($this->data));

        // However, for here we want the length up until the next byte to be
        // processed, so add one to the current byte ($this->char).
        if ($lastLine !== false) {
            $findLengthOf = substr($this->data, $lastLine + 1, $this->char - 1 - $lastLine);
        } else {
            $findLengthOf = substr($this->data, 0, $this->char);
        }

        // Get the length for the string we need.
        if (extension_loaded('iconv')) {
            return iconv_strlen($findLengthOf, 'utf-8');
        } elseif (extension_loaded('mbstring')) {
            return mb_strlen($findLengthOf, 'utf-8');
        } elseif (extension_loaded('xml')) {
            return strlen(utf8_decode($findLengthOf));
        } else {
            $count = count_chars($findLengthOf);
            // 0x80 = 0x7F - 0 + 1 (one added to get inclusive range)
            // 0x33 = 0xF4 - 0x2C + 1 (one added to get inclusive range)
            return array_sum(array_slice($count, 0, 0x80)) +
                   array_sum(array_slice($count, 0xC2, 0x33));
        }
    }
274055
protected function _getIdColumnName()
        {
            if (!is_null($this->_instance_id_column)) {
                return $this->_instance_id_column;
            }

            if (isset(self::$_config[$this->_connection_name]['id_column_overrides'][$this->_table_name])) {
                return self::$_config[$this->_connection_name]['id_column_overrides'][$this->_table_name];
            }

            return self::$_config[$this->_connection_name]['id_column'];
        }
744953
protected function _getNextToken()
    {
        $this->_token      = self::EOF;
        $this->_tokenValue = null;
        $this->_eatWhitespace();

        if ($this->_offset >= $this->_sourceLength) {
            return(self::EOF);
        }

        $str        = $this->_source;
        $str_length = $this->_sourceLength;
        $i          = $this->_offset;
        $start      = $i;

        switch ($str{$i}) {
        case '{':
            $this->_token = self::LBRACE;
            break;
        case '}':
            $this->_token = self::RBRACE;
            break;
        case '[':
            $this->_token = self::LBRACKET;
            break;
        case ']':
            $this->_token = self::RBRACKET;
            break;
        case ',':
            $this->_token = self::COMMA;
            break;
        case ':':
            $this->_token = self::COLON;
            break;
        case  '"':
            $result = '';
            do {
                $i++;
                if ($i >= $str_length) {
                    break;
                }

                $chr = $str{$i};
                if ($chr == '\\') {
                    $i++;
                    if ($i >= $str_length) {
                        break;
                    }
                    $chr = $str{$i};
                    switch ($chr) {
                    case '"' :
                        $result .= '"';
                        break;
                    case '\\':
                        $result .= '\\';
                        break;
                    case '/' :
                        $result .= '/';
                        break;
                    case 'b' :
                        $result .= chr(8);
                        break;
                    case 'f' :
                        $result .= chr(12);
                        break;
                    case 'n' :
                        $result .= chr(10);
                        break;
                    case 'r' :
                        $result .= chr(13);
                        break;
                    case 't' :
                        $result .= chr(9);
                        break;
                    case '\'' :
                        $result .= '\'';
                        break;
                    default:
                        throw new Zend_Json_Exception(
                            "Illegal escape "
                                .  "sequence '" . $chr . "'"
                        );
                    }
                } elseif ($chr == '"') {
                    break;
                } else {
                    $result .= $chr;
                }
            } while ($i < $str_length);

            $this->_token = self::DATUM;
            //$this->_tokenValue = substr($str, $start + 1, $i - $start - 1);
            $this->_tokenValue = $result;
            break;
        case 't':
            if (($i+ 3) < $str_length && substr($str, $start, 4) == "true") {
                $this->_token = self::DATUM;
            }
            $this->_tokenValue = true;
            $i += 3;
            break;
        case 'f':
            if (($i+ 4) < $str_length && substr($str, $start, 5) == "false") {
                $this->_token = self::DATUM;
            }
            $this->_tokenValue = false;
            $i += 4;
            break;
        case 'n':
            if (($i+ 3) < $str_length && substr($str, $start, 4) == "null") {
                $this->_token = self::DATUM;
            }
            $this->_tokenValue = null;
            $i += 3;
            break;
        }

        if ($this->_token != self::EOF) {
            $this->_offset = $i + 1; // Consume the last token character
            return($this->_token);
        }

        $chr = $str{$i};
        if ($chr == '-' || $chr == '.' || ($chr >= '0' && $chr <= '9')) {
            if (preg_match(
                '/-?([0-9])*(\.[0-9]*)?((e|E)((-|\+)?)[0-9]+)?/s',
                $str, $matches, PREG_OFFSET_CAPTURE, $start
            ) && $matches[0][1] == $start
            ) {

                $datum = $matches[0][0];

                if (is_numeric($datum)) {
                    if (preg_match('/^0\d+$/', $datum)) {
                        throw new Zend_Json_Exception("Octal notation not supported by JSON (value: $datum)");
                    } else {
                        $val  = intval($datum);
                        $fVal = floatval($datum);
                        $this->_tokenValue = ($val == $fVal ? $val : $fVal);
                    }
                } else {
                    throw new Zend_Json_Exception("Illegal number format: $datum");
                }

                $this->_token = self::DATUM;
                $this->_offset = $start + strlen($datum);
            }
        } else {
            throw new Zend_Json_Exception('Illegal Token');
        }

        return($this->_token);
    }
1333016
private function getUserId()
    {
        if (!$this->tokenProvider || null === ($token = $this->tokenProvider->getToken())) {
            return;
        }

        if (!$token->getUser() instanceof UserInterface) {
            return;
        }

        return $token->getUser()->getId();
    }
1208976
public function getToken()
    {
        if (isset($_SESSION[$this->session_name])) {
            return $_SESSION[$this->session_name];
        } else {
            $token = uniqid($this->randomString());
            $_SESSION[$this->session_name] = $token;
            return $token;
        }
    }
1346857
public String getAlterUserSQL() {

        StringBuffer sb = new StringBuffer();

        sb.append(Tokens.T_ALTER).append(' ');
        sb.append(Tokens.T_USER).append(' ');
        sb.append(getStatementName()).append(' ');
        sb.append(Tokens.T_SET).append(' ');
        sb.append(Tokens.T_PASSWORD).append(' ');
        sb.append('"').append(password).append('"');

        return sb.toString();
    }