PHP code example of kreait / ezpublish-migrations-bundle

1. Go to this page and download the library: Download kreait/ezpublish-migrations-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kreait / ezpublish-migrations-bundle example snippets


public function registerBundles()
{
    $bundles = array(
        //...
        new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
        new Kreait\EzPublish\MigrationsBundle\KreaitEzPublishMigrationsBundle(),
    );
}

// All subsequent calls will be made as the user with the given name
$this->changeMigrationUser('another_username');

// Restores the current user to the configured migrations user.
$this->restoreDefaultMigrationUser();

$this->createContent($parentLocationId, $contentTypeIdentifier, $languageCode, array $fields);