protected function getUpdateUserSecurityIdentitySql(UserSecurityIdentity $usid, $oldUsername)
    {
        if ($usid->getUsername() == $oldUsername) {
            throw new \InvalidArgumentException('There are no changes.');
        }

        $oldIdentifier = $usid->getClass().'-'.$oldUsername;
        $newIdentifier = $usid->getClass().'-'.$usid->getUsername();

        return sprintf(
            'UPDATE %s SET identifier = %s WHERE identifier = %s AND username = %s',
            $this->options['sid_table_name'],
            $this->connection->quote($newIdentifier),
            $this->connection->quote($oldIdentifier),
            $this->connection->getDatabasePlatform()->convertBooleans(true)
        );
    }
protected function getUpdateUserSecurityIdentitySql(UserSecurityIdentity $usid, $oldUsername)
    {
        if ($usid->getUsername() == $oldUsername) {
            throw new \InvalidArgumentException('There are no changes.');
        }

        $oldIdentifier = $usid->getClass().'-'.$oldUsername;
        $newIdentifier = $usid->getClass().'-'.$usid->getUsername();

        return sprintf(
            'UPDATE %s SET identifier = %s WHERE identifier = %s AND username = %s',
            $this->options['sid_table_name'],
            $this->connection->quote($newIdentifier),
            $this->connection->quote($oldIdentifier),
            $this->connection->getDatabasePlatform()->convertBooleans(true)
        );
    }
protected function getUpdateUserSecurityIdentitySql ( UserSecurityIdentity $ usid , $ oldUsername ) { if ( $ usid -> getUsername ( ) == $ oldUsername ) { throw new \ InvalidArgumentException ( 'There are no changes.' ) ; } $ oldIdentifier = $ usid -> getClass ( ) . '-' . $ oldUsername ; $ newIdentifier = $ usid -> getClass ( ) . '-' . $ usid -> getUsername ( ) ; return sprintf ( 'UPDATE %s SET identifier = %s WHERE identifier = %s AND username = %s' , $ this -> options [ 'sid_table_name' ] , $ this -> connection -> quote ( $ newIdentifier ) , $ this -> connection -> quote ( $ oldIdentifier ) , $ this -> connection -> getDatabasePlatform ( ) -> convertBooleans ( true ) ) ; }
Constructs the SQL for updating a user security identity.

@param UserSecurityIdentity $usid
@param string               $oldUsername

@return string
Constructs the SQL for updating a user security identity .