<?php
namespace JAB\Bundle\TestBundle\Migrations\Schema\v1_1;
use Doctrine\DBAL\Schema\Schema;
use Oro\Bundle\MigrationBundle\Migration\QueryBag;
use Oro\Bundle\MigrationBundle\Migration\Migration;
use Oro\Bundle\NoteBundle\Migration\Extension\NoteExtension;
use Oro\Bundle\NoteBundle\Migration\Extension\NoteExtensionAwareInterface;
/**
* @SuppressWarnings(PHPMD.TooManyMethods)
* @SuppressWarnings(PHPMD.ExcessiveClassLength)
*/
class JABTestBundle implements Migration, NoteExtensionAwareInterface {
/** @var NoteExtension */
protected $noteExtension;
/**
* {@inheritdoc}
*/
public function setNoteExtension(NoteExtension $noteExtension) {
$this->noteExtension = $noteExtension;
}
/**
* @param Schema $schema
* @param QueryBag $queries
*/
public function up(Schema $schema, QueryBag $queries) {
self::addNoteAssociations($schema, $this->noteExtension);
}
/**
* Enable notes for test entity
*
* @param Schema $schema
* @param NoteExtension $noteExtension
*/
public static function addNoteAssociations(Schema $schema, NoteExtension $noteExtension) {
$noteExtension->addNoteAssociation($schema, 'jab_testEntity');
}
}