public function export(string $filename)
    {
        $zip = new CNabuZipBuilder();
        $unlink_files = array();

        if ($this->getObjectsCount() > 0) {
            $file = new CNabuXMLBuilder();
            $package = new CNabuXMLPackage($this->nb_customer);
            if ($this->nb_language_list->getSize() > 0) {
                $package->setXMLLanguageList(new CNabuXMLLanguageList($this->nb_language_list));
            }
            if ($this->nb_role_list->getSize() > 0) {
                $package->setXMLRoleList(new CNabuXMLRoleList($this->nb_role_list));
            }
            if ($this->nb_site_list->getSize() > 0) {
                $package->setXMLSiteList(new CNabuXMLSiteList($this->nb_site_list));
            }
            $file->addFragment($package);
            $file->create();
            $zip->addFragment(new CNabuZipStream($zip, 'data', 'package.xml', $file));
        }

        $zip->exportToFile($filename);

        foreach ($unlink_files as $filename) {
            unlink($filename);
        }
    }
public function export(string $filename)
    {
        $zip = new CNabuZipBuilder();
        $unlink_files = array();

        if ($this->getObjectsCount() > 0) {
            $file = new CNabuXMLBuilder();
            $package = new CNabuXMLPackage($this->nb_customer);
            if ($this->nb_language_list->getSize() > 0) {
                $package->setXMLLanguageList(new CNabuXMLLanguageList($this->nb_language_list));
            }
            if ($this->nb_role_list->getSize() > 0) {
                $package->setXMLRoleList(new CNabuXMLRoleList($this->nb_role_list));
            }
            if ($this->nb_site_list->getSize() > 0) {
                $package->setXMLSiteList(new CNabuXMLSiteList($this->nb_site_list));
            }
            $file->addFragment($package);
            $file->create();
            $zip->addFragment(new CNabuZipStream($zip, 'data', 'package.xml', $file));
        }

        $zip->exportToFile($filename);

        foreach ($unlink_files as $filename) {
            unlink($filename);
        }
    }
public function export ( string $ filename ) { $ zip = new CNabuZipBuilder ( ) ; $ unlink_files = array ( ) ; if ( $ this -> getObjectsCount ( ) > 0 ) { $ file = new CNabuXMLBuilder ( ) ; $ package = new CNabuXMLPackage ( $ this -> nb_customer ) ; if ( $ this -> nb_language_list -> getSize ( ) > 0 ) { $ package -> setXMLLanguageList ( new CNabuXMLLanguageList ( $ this -> nb_language_list ) ) ; } if ( $ this -> nb_role_list -> getSize ( ) > 0 ) { $ package -> setXMLRoleList ( new CNabuXMLRoleList ( $ this -> nb_role_list ) ) ; } if ( $ this -> nb_site_list -> getSize ( ) > 0 ) { $ package -> setXMLSiteList ( new CNabuXMLSiteList ( $ this -> nb_site_list ) ) ; } $ file -> addFragment ( $ package ) ; $ file -> create ( ) ; $ zip -> addFragment ( new CNabuZipStream ( $ zip , 'data' , 'package.xml' , $ file ) ) ; } $ zip -> exportToFile ( $ filename ) ; foreach ( $ unlink_files as $ filename ) { unlink ( $ filename ) ; } }
Export the package to a file and save it using the propietary NAK structure.
@param string $filename File name to export package.
Export the package to a file and save it using the propietary NAK structure .