src/FlexiPeeHP/Company.php
public function restoreBackupFrom($filename, $name = null,
                                      $disableEet = false,
                                      $disableAutoSendMail = false,
                                      $disableWebHooks = false)
    {
        $options = [];
        if (!empty($name)) {
            $options['name'] = $name;
        }
        if ($disableEet === true) {
            $options['disableEet'] = 1;
        }
        if ($disableAutoSendMail === true) {
            $options['disableAutoSendMail'] = 1;
        }
        if ($disableWebHooks === true) {
            $options['disableWebHooks'] = 1;
        }

        $headersBackup                            = $this->defaultHttpHeaders;
        $this->defaultHttpHeaders['Accept']       = '*/*';
        $this->defaultHttpHeaders['Content-Type'] = 'application/x-winstrom-backup';
        $this->setPostFields(file_get_contents($filename));
        $this->performRequest('restore'.(empty($options) ? '' : '?'.http_build_query($options) ),
            'PUT');
        return $this->lastResponseCode == 200;
    }
public function restoreBackupFrom($filename, $name = null,
                                      $disableEet = false,
                                      $disableAutoSendMail = false,
                                      $disableWebHooks = false)
    {
        $options = [];
        if (!empty($name)) {
            $options['name'] = $name;
        }
        if ($disableEet === true) {
            $options['disableEet'] = 1;
        }
        if ($disableAutoSendMail === true) {
            $options['disableAutoSendMail'] = 1;
        }
        if ($disableWebHooks === true) {
            $options['disableWebHooks'] = 1;
        }

        $headersBackup                            = $this->defaultHttpHeaders;
        $this->defaultHttpHeaders['Accept']       = '*/*';
        $this->defaultHttpHeaders['Content-Type'] = 'application/x-winstrom-backup';
        $this->setPostFields(file_get_contents($filename));
        $this->performRequest('restore'.(empty($options) ? '' : '?'.http_build_query($options) ),
            'PUT');
        return $this->lastResponseCode == 200;
    }
public function restoreBackupFrom ( $ filename , $ name = null , $ disableEet = false , $ disableAutoSendMail = false , $ disableWebHooks = false ) { $ options = [ ] ; if ( ! empty ( $ name ) ) { $ options [ 'name' ] = $ name ; } if ( $ disableEet === true ) { $ options [ 'disableEet' ] = 1 ; } if ( $ disableAutoSendMail === true ) { $ options [ 'disableAutoSendMail' ] = 1 ; } if ( $ disableWebHooks === true ) { $ options [ 'disableWebHooks' ] = 1 ; } $ headersBackup = $ this -> defaultHttpHeaders ; $ this -> defaultHttpHeaders [ 'Accept' ] = '*/*' ; $ this -> defaultHttpHeaders [ 'Content-Type' ] = 'application/x-winstrom-backup' ; $ this -> setPostFields ( file_get_contents ( $ filename ) ) ; $ this -> performRequest ( 'restore' . ( empty ( $ options ) ? '' : '?' . http_build_query ( $ options ) ) , 'PUT' ) ; return $ this -> lastResponseCode == 200 ; }
Restore company from given file

@link https://www.flexibee.eu/api/dokumentace/ref/restore-backup/ Obnovení ze zálohy

@param string $filename             *.winstrom-backup file
@param string $name                 Extra name for restored company
@param boolean $disableEet          Disable EET on restored company
@param boolean $disableAutoSendMail Dsable auto sending of all documents
@param boolean $disableWebHooks     Remove Registered webhooks

@return boolean restore result
Restore company from given file