Saves the content to the disk

@param array $array
@return boolean Depending on success
494465
public function save()
    {
        $this->load();
        // Do the work in case we have only changed hash
        if ($this->isChanged()) {
            @chmod($this->path, 0777);
            return file_put_contents($this->path, $this->fileType->render($this->config));
        } else {
            return true;
        }
    }
650362
public static function save($array, $filename) {
		$content = "<?php\nreturn " . self::asPhpArray ( $array, "array", 1, true ) . ";";
		return UFileSystem::save ( $filename, $content );
	}
667830
public function copyToArray(array &$array)
    {
        $array['start']      = $this->start;
        $array['end']        = $this->end;
        $array['totalCount'] = $this->totalCount;
        $array['services']   = LanguageUtility::convertArrayOfArrayCopyableToArray($this->services);
    }
70786
public static function isAssoc(array $array): bool
    {
        if (empty($array)) {
            return false;
        }

        foreach (array_keys($array) as $key) {
            if (\is_string($key)) {
                return true;
            }
        }

        return false;
    }
172040
public function copyFromArray(array &$array)
    {
        // accessToken
        $this->setAccessToken(
            LanguageUtility::getFromArray('accessToken', $array));

        // accessTokenExpiresAt
        $this->setAccessTokenExpiresAt(
            LanguageUtility::getFromArray('accessTokenExpiresAt', $array));

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

        // properties
        $properties = LanguageUtility::getFromArray('properties', $array);
        $this->setProperties(
            LanguageUtility::convertArrayToArrayOfArrayCopyable(
                $properties, __NAMESPACE__ . '\Property'));
    }
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));
    }
1296615
public function copyFromArray(array &$array)
    {
        // formatted
        $this->setFormatted(
            LanguageUtility::getFromArray('formatted', $array));

        // street_address
        $this->setStreetAddress(
            LanguageUtility::getFromArray('street_address', $array));

        // locality
        $this->setLocality(
            LanguageUtility::getFromArray('locality', $array));

        // region
        $this->setRegion(
            LanguageUtility::getFromArray('region', $array));

        // postal_code
        $this->setPostalCode(
            LanguageUtility::getFromArray('postal_code', $array));

        // country
        $this->setCountry(
            LanguageUtility::getFromArray('country', $array));
    }
28059
public function copyToArray(array &$array)
    {
        parent::copyToArray($array);

        $array['action']                = LanguageUtility::toString($this->action);
        $array['responseContent']       = $this->responseContent;
        $array['username']              = $this->username;
        $array['password']              = $this->password;
        $array['ticket']                = $this->ticket;
        $array['accessToken']           = $this->accessToken;
        $array['accessTokenExpiresAt']  = LanguageUtility::orZero($this->accessTokenExpiresAt);
        $array['accessTokenDuration']   = LanguageUtility::orZero($this->accessTokenDuration);
        $array['refreshToken']          = $this->refreshToken;
        $array['refreshTokenExpiresAt'] = LanguageUtility::orZero($this->refreshTokenExpiresAt);
        $array['refreshTokenDuration']  = LanguageUtility::orZero($this->refreshTokenDuration);
        $array['idToken']               = $this->idToken;
        $array['grantType']             = LanguageUtility::toString($this->grantType);
        $array['clientId']              = $this->clientId;
        $array['clientIdAlias']         = $this->clientIdAlias;
        $array['clientIdAliasUsed']     = $this->clientIdAliasUsed;
        $array['subject']               = $this->subject;
        $array['scopes']                = $this->scopes;
        $array['properties']            = LanguageUtility::convertArrayOfArrayCopyableToArray($this->properties);
    }
710634
public function copyFromArray(array &$array)
    {
        // start
        $this->setStart(
            LanguageUtility::getFromArray('start', $array));

        // end
        $this->setEnd(
            LanguageUtility::getFromArray('end', $array));

        // totalCount
        $this->setTotalCount(
            LanguageUtility::getFromArray('totalCount', $array));

        // services
        $this->setServices(
            LanguageUtility::convertArrayToArrayOfArrayCopyable(
                LanguageUtility::getFromArray('services', $array),
                __NAMESPACE__ . '\Service'));
    }
72358
public function setAll($array) {
		$this->array = $array;
		$this->fileMap = null;

		$this->saver->save($this->fileName, $this->array, $this->fileMap);
	}
1291186
public function copyFromArray(array &$array)
    {
        parent::copyFromArray($array);

        // serviceApiKey
        $this->setServiceApiKey(
            LanguageUtility::getFromArray('serviceApiKey', $array));

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

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

        // latestGrantedScopes
        $this->setLatestGrantedScopes(
            LanguageUtility::getFromArray('latestGrantedScopes', $array));

        // mergedGrantedScopes
        $this->setMergedGrantedScopes(
            LanguageUtility::getFromArray('mergedGrantedScopes', $array));

        // modifiedAt
        $this->setModifiedAt(
            LanguageUtility::getFromArray('modifiedAt', $array));
    }
762582
protected function shuffleAssoc(&$array) 
    {
        $keys = array_keys($array);
        shuffle($keys);
        shuffle($keys);
    
        foreach($keys as $key) 
        {
            $new[$key] = $array[$key];
            unset($array[$key]); /* save memory */
        }
        $array = $new;
        
        return true;
    }
45544
public function copyFromArray(array &$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));

        // accessTokenDuration
        $this->setAccessTokenDuration(
            LanguageUtility::getFromArray('accessTokenDuration', $array));

        // refreshTokenDuration
        $this->setRefreshTokenDuration(
            LanguageUtility::getFromArray('refreshTokenDuration', $array));

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

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

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

        // refreshToken
        $this->setRefreshToken(
            LanguageUtility::getFromArray('refreshToken', $array));
    }
41501
public function copyFromArray(array &$array)
    {
        parent::copyFromArray($array);

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

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

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

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

        // existent
        $this->setExistent(
            LanguageUtility::getFromArrayAsBoolean('existent', $array));

        // usable
        $this->setUsable(
            LanguageUtility::getFromArrayAsBoolean('usable', $array));

        // sufficient
        $this->setSufficient(
            LanguageUtility::getFromArrayAsBoolean('sufficient', $array));

        // refreshable
        $this->setRefreshable(
            LanguageUtility::getFromArrayAsBoolean('refreshable', $array));

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

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

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

        // clientIdAlias
        $this->setClientIdAlias(
            LanguageUtility::getFromArray('clientIdAlias', $array));

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

        // certificateThumbprint
        $this->setCertificateThumbprint(
            LanguageUtility::getFromArray('certificateThumbprint', $array));
    }
460040
protected function saveFile(array $object, $location) {
		//Serialize and save the object to a store in the Cake's tmp dir.
		if (!file_exists($location)) {
			if (!mkdir($location, 0770, true)) {
				//Throw error, directory is requird
				throw new NotFoundException('Could not create directory to save feedbacks in. Please provide write rights to webserver user on directory: ' . $location);
			}
		}

		if (file_put_contents($location . $object['filename'], serialize($object))) {
			//Add filename to data
			return true;
		}
		return false;
	}
535198
public function save(array $data = [], array $dirt = [])
    {
        if ($dirt != null) {
            file_put_contents($this->filePath, json_encode($data));
            return true;
        }

        return false;
    }
1326300
public function copyFromArray(array &$array)
    {
        // parameters
        $this->setParameters(
            LanguageUtility::getFromArray('parameters', $array));

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

        // clientSecret
        $this->setClientSecret(
            LanguageUtility::getFromArray('clientSecret', $array));
    }