Skip to content
This repository has been archived by the owner on May 11, 2018. It is now read-only.

Latest commit

 

History

History
33 lines (27 loc) · 660 Bytes

03-create-new-content.md

File metadata and controls

33 lines (27 loc) · 660 Bytes

Example 03

Create new content
namespace Application\Migrations;

use Kreait\EzPublish\MigrationsBundle\Migrations\EzPublishMigration;
use Doctrine\DBAL\Schema\Schema;

class Version20150610145137 extends EzPublishMigration
{
    /**
     * @param Schema $schema
     */
    public function up(Schema $schema)
    {
        $this->createContent(2, 'folder', 'eng-GB', [
            'name' => 'This is a new folder',
            'short_name' => 'New folder'
        ]);
    }

    /**
     * @param Schema $schema
     */
    public function down(Schema $schema)
    {
        // We probably should somehow delete the content again.
    }
}