Does either overwrite the passed ACE, or saves it in the global identity
map to ensure every ACE only gets instantiated once.

@param array &$aces
179870
private function doUpdateAceIdentityMap(array &$aces)
    {
        foreach ($aces as $index => $ace) {
            if (isset($this->loadedAces[$ace->getId()])) {
                $aces[$index] = $this->loadedAces[$ace->getId()];
            } else {
                $this->loadedAces[$ace->getId()] = $ace;
            }
        }
    }
1361359
public function removeEntry(Entry $ace)
    {
        foreach ($this->entries as $index => $entry) {
            if ($ace->getId() === $entry->getId()) {
                unset($this->entries[$index]);
            }
        }

        return $this;
    }
487717
public function copyFromArray(array &$array)
    {
        parent::copyFromArray($array);

        // action
        $this->setAction(
            TokenCreateAction::valueOf(
                LanguageUtility::getFromArray('action', $array)));

        // grantType
        $this->setGrantType(
            GrantType::valueOf(
                LanguageUtility::getFromArray('grantType', $array)));

        // clientId
        $this->setClientId(
            LanguageUtility::getFromArray('clientId', $array));

        // subject
        $this->setSubject(
            LanguageUtility::getFromArray('subject', $array));

        // scopes
        $this->setScopes(
            LanguageUtility::getFromArray('scopes', $array));

        // accessToken
        $this->setAccessToken(
            LanguageUtility::getFromArray('accessToken', $array));

        // tokenType
        $this->setTokenType(
            LanguageUtility::getFromArray('tokenType', $array));

        // expiresIn
        $this->setExpiresIn(
            LanguageUtility::getFromArray('expiresIn', $array));

        // expiresAt
        $this->setExpiresAt(
            LanguageUtility::getFromArray('expiresAt', $array));

        // refreshToken
        $this->setRefreshToken(
            LanguageUtility::getFromArray('refreshToken', $array));

        // properties
        $properties = LanguageUtility::getFromArray('properties', $array);
        $this->setProperties(
            LanguageUtility::convertArrayToArrayOfArrayCopyable(
                $properties, __NAMESPACE__ . '\Property'));
    }
1123098
protected function shuffle_assoc(&$array) {
        if (count($array) > 1) {
            // $keys needs to be an array, no need to shuffle 1 item or empty arrays, anyway
            $keys = array_keys($array);
            shuffle($keys);
            foreach($keys as $key) {
                $new[$key] = $array[$key];
            }
            $array = $new;
        }
        return true; // because this behaves like in-built shuffle(), which returns true
    }
1267861
public function copyFromArray(array &$array)
    {
        parent::copyFromArray($array);

        // action
        $this->setAction(
            AuthorizationAction::valueOf(
                LanguageUtility::getFromArray('action', $array)));

        // service
        $service = LanguageUtility::getFromArray('service', $array);
        $this->setService(
            LanguageUtility::convertArrayToArrayCopyable(
                $service, __NAMESPACE__ . '\Service'));

        // client
        $client = LanguageUtility::getFromArray('client', $array);
        $this->setClient(
            LanguageUtility::convertArrayToArrayCopyable(
                $client, __NAMESPACE__ . '\Client'));

        // clientIdAliasUsed
        $this->setClientIdAliasUsed(
            LanguageUtility::getFromArrayAsBoolean('clientIdAliasUsed', $array));

        // display
        $this->setDisplay(
            Display::valueOf(
                LanguageUtility::getFromArray('display', $array)));

        // maxAge
        $this->setMaxAge(
            LanguageUtility::getFromArray('maxAge', $array));

        // scopes
        $scopes = LanguageUtility::getFromArray('scopes', $array);
        $this->setScopes(
            LanguageUtility::convertArrayToArrayOfArrayCopyable(
                $scopes, __NAMESPACE__ . '\Scope'));

        // uiLocales
        $this->setUiLocales(
            LanguageUtility::getFromArray('uiLocales', $array));

        // claimsLocales
        $this->setClaimsLocales(
            LanguageUtility::getFromArray('claimsLocales', $array));

        // claims
        $this->setClaims(
            LanguageUtility::getFromArray('claims', $array));

        // acrEssential
        $this->setAcrEssential(
            LanguageUtility::getFromArrayAsBoolean('acrEssential', $array));

        // acrs
        $this->setAcrs(
            LanguageUtility::getFromArray('acrs', $array));

        // subject
        $this->setSubject(
            LanguageUtility::getFromArray('subject', $array));

        // loginHint
        $this->setLoginHint(
            LanguageUtility::getFromArray('loginHint', $array));

        // prompts
        $prompts = LanguageUtility::getFromArray('prompts', $array);
        $this->setPrompts(
            LanguageUtility::convertArray(
                $prompts,
                '\Authlete\Types\Prompt::valueOf'));

        // requestObjectPayload
        $this->setRequestObjectPayload(
            LanguageUtility::getFromArray('requestObjectPayload', $array));

        // idTokenClaims
        $this->setIdTokenClaims(
            LanguageUtility::getFromArray('idTokenClaims', $array));

        // userInfoClaims
        $this->setUserInfoClaims(
            LanguageUtility::getFromArray('userInfoClaims', $array));

        // responseContent
        $this->setResponseContent(
            LanguageUtility::getFromArray('responseContent', $array));

        // ticket
        $this->setTicket(
            LanguageUtility::getFromArray('ticket', $array));
    }
415084
public function setOriginal($data)
    {
        if (is_array($this->column)) {
            foreach ($this->column as $key => $column) {
                $this->original[$key] = Arr::get($data, $column);
            }

            return;
        }

        $this->original = Arr::get($data, $this->column);
    }
16808
public function setOriginal($data)
    {
        if (is_array($this->column)) {
            foreach ($this->column as $key => $column) {
                $this->original[$key] = array_get($data, $column);
            }

            return;
        }

        $this->original = array_get($data, $this->column);
    }
303043
public function setPersistentData ($key, $value)
    {
        if (!in_array($key, self::$kSupportedKeys)) {
            throw new AuthenticationException('Unsupported key passed to setPersistentData.');
        }
        $this->saveInFile($key.'='.$value);
    }
742148
public function offsetUnset($offset)
    {
        if ($offset instanceof UniqueId) {
            $offset = $offset->id();
        }

        $this->elements->offsetUnset($offset);
    }
948730
public function mergeIdentities($identities)
	{
		if ($identities instanceof Rule)
		{
			$identities = $identities->getData();
		}

		if (is_array($identities))
		{
			foreach ($identities as $identity => $allow)
			{
				$this->mergeIdentity($identity, $allow);
			}
		}
	}
311958
public function overwrite($key, $value=null)
    {
        if (!is_array($key)) {
            $this->overwrittenData[$key] = $value;
            return $this;
        }

        foreach ($key as $k=>$v) {
            $this->overwrite($k, $v);
        }

        return $this;
    }
609707
public static function overwrite(array $set1, array $set2) {
        $overwrite = array_intersect_key($set2, $set1);

        if ($overwrite) {
            foreach ($overwrite as $key => $value) {
                if (is_array($value)) {
                    $set1[$key] = static::overwrite($set1[$key], $value);
                } else {
                    $set1[$key] = $value;
                }
            }
        }

        return $set1;
    }
1283996
public function setData( array $array ) {
        foreach( $array as $name=>$value ) {
            if( !isset( $this->nameHash[$name] ) ) {
                continue;
            }

            $element = $this->nameHash[$name];

            $element->setAttribute( 'value', (string)$value );
        }
    }
150910
public function offsetUnset($offset)
    {
        if ($this->offsetExists($offset) && $this->internalFilterHooks($offset, null, 'remove')) {
            $oldData = $this->offsetGet($offset);

            unset($this->baseConcreteData[$offset]);
            if (($index = array_search($offset, $this->baseArrayMap, true)) !== false) {
                unset($this->baseArrayMap[$index]);
            }
            $this->baseArrayMap = array_values($this->baseArrayMap);

            $this->arrayAccessMapIndex = count($this->baseArrayMap);

            $this->internalChangingHooks($offset, null, $oldData, 'remove');
        }
    }
1241609
public function copyFromArray(array &$array)
    {
        // ticket
        $this->setTicket(
            LanguageUtility::getFromArray('ticket', $array));

        // subject
        $this->setSubject(
            LanguageUtility::getFromArray('subject', $array));

        // sub
        $this->setSub(
            LanguageUtility::getFromArray('sub', $array));

        // authTime
        $this->setAuthTime(
            LanguageUtility::getFromArray('authTime', $array));

        // acr
        $this->setAcr(
            LanguageUtility::getFromArray('acr', $array));

        // claims
        $this->setClaims(
            LanguageUtility::getFromArray('claims', $array));

        // properties
        $properties = LanguageUtility::getFromArray('properties', $array);
        $this->setProperties(
            LanguageUtility::convertArrayToArrayOfArrayCopyable(
                $properties, __NAMESPACE__ . '\Property'));

        // scopes
        $this->setScopes(
            LanguageUtility::getFromArray('scopes', $array));
    }
565869
public function set_areas(array $areas) {
        foreach ($areas as $area) {
            if ($area instanceof base && !key_exists($area->get_area_id(), $this->areas)) {
                $this->areas[$area->get_area_id()] = $area;
            }
        }
    }
323917
public function copyFromArray(array &$array)
    {
        // token
        $this->setToken(
            LanguageUtility::getFromArray('token', $array));

        // claims
        $this->setClaims(
            LanguageUtility::getFromArray('claims', $array));

        // sub
        $this->setSub(
            LanguageUtility::getFromArray('sub', $array));
    }