Your IP : 216.73.216.86


Current Path : /var/www/homesaver/www/bitrix/modules/sprint.migration/templates/
Upload File :
Current File : /var/www/homesaver/www/bitrix/modules/sprint.migration/templates/MedialibElementsExport.php

<?php

/**
 * @var $version
 * @var $description
 * @var $extendUse
 * @var $extendClass
 * @var $moduleVersion
 * @var $iblockElementsFile
 * @var $author
 * @formatter:off
 */

?><?php echo "<?php\n" ?>

namespace Sprint\Migration;

<?php echo $extendUse ?>

class <?php echo $version ?> extends <?php echo $extendClass ?>

{

    protected $author = "<?php echo $author ?>";

    protected $description = "<?php echo $description ?>";

    protected $moduleVersion = "<?php echo $moduleVersion ?>";

    /**
     * @throws Exceptions\MigrationException
     * @throws Exceptions\RestartException
     * @throws Exceptions\HelperException
     * @return bool|void
     */
    public function up()
    {
        $this->getExchangeManager()
             ->MedialibElementsImport()
             ->setExchangeResource('medialib_elements.xml')
             ->setLimit(20)
             ->execute(
                 function ($item) {
                     $this->getHelperManager()
                          ->Medialib()
                          ->saveElement($item);
                 }
             );
    }
}