public function createContentMigration($data)
    {
        $manifest = [];

        $migration = array(
            'content' => array(),
        );

        $empty = true;
        $plugin = MigrationManager::getInstance();

        foreach ($this->_contentMigrationTypes as $key => $value) {
            $service = $plugin->get($value);

            if (array_key_exists($service->getSource(), $data)) {
                $migration['content'][$service->getDestination()] = $service->export($data[$service->getSource()], true);
                $empty = false;

                if ($service->hasErrors()) {
                    $errors = $service->getErrors();
                    foreach ($errors as $error) {
                        Craft::error($error);
                    }

                    return false;
                }
                $manifest = array_merge($manifest, [$key => $service->getManifest()]);
            }
        }

        if ($empty) {
            $migration = null;
        }

        $this->createMigration($migration, $manifest);

        return true;
    }
public function createContentMigration($data)
    {
        $manifest = [];

        $migration = array(
            'content' => array(),
        );

        $empty = true;
        $plugin = MigrationManager::getInstance();

        foreach ($this->_contentMigrationTypes as $key => $value) {
            $service = $plugin->get($value);

            if (array_key_exists($service->getSource(), $data)) {
                $migration['content'][$service->getDestination()] = $service->export($data[$service->getSource()], true);
                $empty = false;

                if ($service->hasErrors()) {
                    $errors = $service->getErrors();
                    foreach ($errors as $error) {
                        Craft::error($error);
                    }

                    return false;
                }
                $manifest = array_merge($manifest, [$key => $service->getManifest()]);
            }
        }

        if ($empty) {
            $migration = null;
        }

        $this->createMigration($migration, $manifest);

        return true;
    }
public function createContentMigration ( $ data ) { $ manifest = [ ] ; $ migration = array ( 'content' => array ( ) , ) ; $ empty = true ; $ plugin = MigrationManager :: getInstance ( ) ; foreach ( $ this -> _contentMigrationTypes as $ key => $ value ) { $ service = $ plugin -> get ( $ value ) ; if ( array_key_exists ( $ service -> getSource ( ) , $ data ) ) { $ migration [ 'content' ] [ $ service -> getDestination ( ) ] = $ service -> export ( $ data [ $ service -> getSource ( ) ] , true ) ; $ empty = false ; if ( $ service -> hasErrors ( ) ) { $ errors = $ service -> getErrors ( ) ; foreach ( $ errors as $ error ) { Craft :: error ( $ error ) ; } return false ; } $ manifest = array_merge ( $ manifest , [ $ key => $ service -> getManifest ( ) ] ) ; } } if ( $ empty ) { $ migration = null ; } $ this -> createMigration ( $ migration , $ manifest ) ; return true ; }
create a new migration file based on selected content elements

@param $data

@return bool
create a new migration file based on selected content elements