mirror of
https://github.com/ToxicCrack/PrintABrick.git
synced 2025-05-18 05:10:07 -07:00
Add doctrine fixtures
This commit is contained in:
parent
3a8e2d6986
commit
ede71ac9b5
@ -14,7 +14,6 @@ class AppKernel extends Kernel
|
||||
new Symfony\Bundle\MonologBundle\MonologBundle(),
|
||||
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
|
||||
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
|
||||
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
|
||||
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
|
||||
new AppBundle\AppBundle(),
|
||||
new Knp\Bundle\MenuBundle\KnpMenuBundle(),
|
||||
@ -29,6 +28,7 @@ class AppKernel extends Kernel
|
||||
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
|
||||
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
|
||||
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
|
||||
$bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
|
||||
}
|
||||
|
||||
return $bundles;
|
||||
|
@ -1,98 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
class Version20170423104850 extends AbstractMigration
|
||||
{
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
|
||||
|
||||
$this->addSql('CREATE TABLE color (id INT NOT NULL, rgb VARCHAR(6) NOT NULL, transparent TINYINT(1) NOT NULL, name VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE ldraw_alias (id VARCHAR(255) NOT NULL, model_id VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_D8089261BF396750 (id), INDEX IDX_D80892617975B7E7 (model_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE ldraw_author (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_7041BAA25E237E06 (name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE ldraw_category (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_3AE257765E237E06 (name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE ldraw_keyword (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_F739171F5E237E06 (name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE ldraw_model (id VARCHAR(255) NOT NULL, category_id INT DEFAULT NULL, author_id INT DEFAULT NULL, name VARCHAR(255) DEFAULT NULL, path VARCHAR(255) DEFAULT NULL, modified DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_EEF18B2CBF396750 (id), INDEX IDX_EEF18B2C12469DE2 (category_id), INDEX IDX_EEF18B2CF675F31B (author_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE model_keyword (model_id VARCHAR(255) NOT NULL, keyword_id INT NOT NULL, INDEX IDX_3A0018CA7975B7E7 (model_id), INDEX IDX_3A0018CA115D4552 (keyword_id), PRIMARY KEY(model_id, keyword_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE ldraw_subpart (parent_id VARCHAR(255) NOT NULL, subpart_id VARCHAR(255) NOT NULL, color_id INT NOT NULL, count INT NOT NULL, INDEX IDX_3D106469727ACA70 (parent_id), INDEX IDX_3D106469781E323 (subpart_id), INDEX IDX_3D1064697ADA1FB5 (color_id), PRIMARY KEY(parent_id, subpart_id, color_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE rebrickable_category (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE rebrickable_inventory (id INT AUTO_INCREMENT NOT NULL, set_id VARCHAR(255) DEFAULT NULL, version INT NOT NULL, INDEX IDX_A88A6D6810FB0D18 (set_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE rebrickable_inventory_parts (color_id INT NOT NULL, spare TINYINT(1) NOT NULL, part_id VARCHAR(255) NOT NULL, inventory_id INT NOT NULL, quantity INT NOT NULL, INDEX IDX_33F22F2E7ADA1FB5 (color_id), INDEX IDX_33F22F2E4CE34BEC (part_id), INDEX IDX_33F22F2E9EEA759 (inventory_id), PRIMARY KEY(color_id, spare, part_id, inventory_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE rebrickable_inventory_sets (inventory_id INT NOT NULL, set_id VARCHAR(255) NOT NULL, quantity INT NOT NULL, INDEX IDX_23DA8E2F9EEA759 (inventory_id), INDEX IDX_23DA8E2F10FB0D18 (set_id), PRIMARY KEY(inventory_id, set_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE rebrickable_part (id VARCHAR(255) NOT NULL, category_id INT DEFAULT NULL, model_id VARCHAR(255) DEFAULT NULL, name VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_38E480B2BF396750 (id), INDEX IDX_38E480B212469DE2 (category_id), INDEX IDX_38E480B27975B7E7 (model_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE rebrickable_set (id VARCHAR(255) NOT NULL, theme_id INT DEFAULT NULL, year INT DEFAULT NULL, num_parts INT DEFAULT NULL, name VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_BC61D898BF396750 (id), INDEX IDX_BC61D89859027487 (theme_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
|
||||
$this->addSql('CREATE TABLE rebrickable_theme (id INT AUTO_INCREMENT NOT NULL, parent_id INT DEFAULT NULL, name VARCHAR(255) DEFAULT NULL, INDEX IDX_C06CB9DD727ACA70 (parent_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
|
||||
$this->addSql('ALTER TABLE ldraw_alias ADD CONSTRAINT FK_D80892617975B7E7 FOREIGN KEY (model_id) REFERENCES ldraw_model (id)');
|
||||
$this->addSql('ALTER TABLE ldraw_model ADD CONSTRAINT FK_EEF18B2C12469DE2 FOREIGN KEY (category_id) REFERENCES ldraw_category (id)');
|
||||
$this->addSql('ALTER TABLE ldraw_model ADD CONSTRAINT FK_EEF18B2CF675F31B FOREIGN KEY (author_id) REFERENCES ldraw_author (id)');
|
||||
$this->addSql('ALTER TABLE model_keyword ADD CONSTRAINT FK_3A0018CA7975B7E7 FOREIGN KEY (model_id) REFERENCES ldraw_model (id) ON DELETE CASCADE');
|
||||
$this->addSql('ALTER TABLE model_keyword ADD CONSTRAINT FK_3A0018CA115D4552 FOREIGN KEY (keyword_id) REFERENCES ldraw_keyword (id) ON DELETE CASCADE');
|
||||
$this->addSql('ALTER TABLE ldraw_subpart ADD CONSTRAINT FK_3D106469727ACA70 FOREIGN KEY (parent_id) REFERENCES ldraw_model (id)');
|
||||
$this->addSql('ALTER TABLE ldraw_subpart ADD CONSTRAINT FK_3D106469781E323 FOREIGN KEY (subpart_id) REFERENCES ldraw_model (id)');
|
||||
$this->addSql('ALTER TABLE ldraw_subpart ADD CONSTRAINT FK_3D1064697ADA1FB5 FOREIGN KEY (color_id) REFERENCES color (id)');
|
||||
$this->addSql('ALTER TABLE rebrickable_inventory ADD CONSTRAINT FK_A88A6D6810FB0D18 FOREIGN KEY (set_id) REFERENCES rebrickable_set (id)');
|
||||
$this->addSql('ALTER TABLE rebrickable_inventory_parts ADD CONSTRAINT FK_33F22F2E7ADA1FB5 FOREIGN KEY (color_id) REFERENCES color (id)');
|
||||
$this->addSql('ALTER TABLE rebrickable_inventory_parts ADD CONSTRAINT FK_33F22F2E4CE34BEC FOREIGN KEY (part_id) REFERENCES rebrickable_part (id)');
|
||||
$this->addSql('ALTER TABLE rebrickable_inventory_parts ADD CONSTRAINT FK_33F22F2E9EEA759 FOREIGN KEY (inventory_id) REFERENCES rebrickable_inventory (id)');
|
||||
$this->addSql('ALTER TABLE rebrickable_inventory_sets ADD CONSTRAINT FK_23DA8E2F9EEA759 FOREIGN KEY (inventory_id) REFERENCES rebrickable_inventory (id)');
|
||||
$this->addSql('ALTER TABLE rebrickable_inventory_sets ADD CONSTRAINT FK_23DA8E2F10FB0D18 FOREIGN KEY (set_id) REFERENCES rebrickable_set (id)');
|
||||
$this->addSql('ALTER TABLE rebrickable_part ADD CONSTRAINT FK_38E480B212469DE2 FOREIGN KEY (category_id) REFERENCES rebrickable_category (id)');
|
||||
$this->addSql('ALTER TABLE rebrickable_part ADD CONSTRAINT FK_38E480B27975B7E7 FOREIGN KEY (model_id) REFERENCES ldraw_model (id)');
|
||||
$this->addSql('ALTER TABLE rebrickable_set ADD CONSTRAINT FK_BC61D89859027487 FOREIGN KEY (theme_id) REFERENCES rebrickable_theme (id)');
|
||||
$this->addSql('ALTER TABLE rebrickable_theme ADD CONSTRAINT FK_C06CB9DD727ACA70 FOREIGN KEY (parent_id) REFERENCES rebrickable_theme (id) ON DELETE SET NULL');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
|
||||
|
||||
$this->addSql('ALTER TABLE ldraw_subpart DROP FOREIGN KEY FK_3D1064697ADA1FB5');
|
||||
$this->addSql('ALTER TABLE rebrickable_inventory_parts DROP FOREIGN KEY FK_33F22F2E7ADA1FB5');
|
||||
$this->addSql('ALTER TABLE ldraw_model DROP FOREIGN KEY FK_EEF18B2CF675F31B');
|
||||
$this->addSql('ALTER TABLE ldraw_model DROP FOREIGN KEY FK_EEF18B2C12469DE2');
|
||||
$this->addSql('ALTER TABLE model_keyword DROP FOREIGN KEY FK_3A0018CA115D4552');
|
||||
$this->addSql('ALTER TABLE ldraw_alias DROP FOREIGN KEY FK_D80892617975B7E7');
|
||||
$this->addSql('ALTER TABLE model_keyword DROP FOREIGN KEY FK_3A0018CA7975B7E7');
|
||||
$this->addSql('ALTER TABLE ldraw_subpart DROP FOREIGN KEY FK_3D106469727ACA70');
|
||||
$this->addSql('ALTER TABLE ldraw_subpart DROP FOREIGN KEY FK_3D106469781E323');
|
||||
$this->addSql('ALTER TABLE rebrickable_part DROP FOREIGN KEY FK_38E480B27975B7E7');
|
||||
$this->addSql('ALTER TABLE rebrickable_part DROP FOREIGN KEY FK_38E480B212469DE2');
|
||||
$this->addSql('ALTER TABLE rebrickable_inventory_parts DROP FOREIGN KEY FK_33F22F2E9EEA759');
|
||||
$this->addSql('ALTER TABLE rebrickable_inventory_sets DROP FOREIGN KEY FK_23DA8E2F9EEA759');
|
||||
$this->addSql('ALTER TABLE rebrickable_inventory_parts DROP FOREIGN KEY FK_33F22F2E4CE34BEC');
|
||||
$this->addSql('ALTER TABLE rebrickable_inventory DROP FOREIGN KEY FK_A88A6D6810FB0D18');
|
||||
$this->addSql('ALTER TABLE rebrickable_inventory_sets DROP FOREIGN KEY FK_23DA8E2F10FB0D18');
|
||||
$this->addSql('ALTER TABLE rebrickable_set DROP FOREIGN KEY FK_BC61D89859027487');
|
||||
$this->addSql('ALTER TABLE rebrickable_theme DROP FOREIGN KEY FK_C06CB9DD727ACA70');
|
||||
$this->addSql('DROP TABLE color');
|
||||
$this->addSql('DROP TABLE ldraw_alias');
|
||||
$this->addSql('DROP TABLE ldraw_author');
|
||||
$this->addSql('DROP TABLE ldraw_category');
|
||||
$this->addSql('DROP TABLE ldraw_keyword');
|
||||
$this->addSql('DROP TABLE ldraw_model');
|
||||
$this->addSql('DROP TABLE model_keyword');
|
||||
$this->addSql('DROP TABLE ldraw_subpart');
|
||||
$this->addSql('DROP TABLE rebrickable_category');
|
||||
$this->addSql('DROP TABLE rebrickable_inventory');
|
||||
$this->addSql('DROP TABLE rebrickable_inventory_parts');
|
||||
$this->addSql('DROP TABLE rebrickable_inventory_sets');
|
||||
$this->addSql('DROP TABLE rebrickable_part');
|
||||
$this->addSql('DROP TABLE rebrickable_set');
|
||||
$this->addSql('DROP TABLE rebrickable_theme');
|
||||
}
|
||||
}
|
@ -1,176 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
class Version20170423104943 extends AbstractMigration
|
||||
{
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
|
||||
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (-1, '0033B2', 0, 'Unknown')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (0, '05131D', 0, 'Black')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (1, '0055BF', 0, 'Blue')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (2, '237841', 0, 'Green')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (3, '008F9B', 0, 'Dark Turquoise')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (4, 'C91A09', 0, 'Red')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (5, 'C870A0', 0, 'Dark Pink')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (6, '583927', 0, 'Brown')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (7, '9BA19D', 0, 'Light Gray')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (8, '6D6E5C', 0, 'Dark Gray')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (9, 'B4D2E3', 0, 'Light Blue')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (10, '4B9F4A', 0, 'Bright Green')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (11, '55A5AF', 0, 'Light Turquoise')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (12, 'F2705E', 0, 'Salmon')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (13, 'FC97AC', 0, 'Pink')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (14, 'F2CD37', 0, 'Yellow')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (15, 'FFFFFF', 0, 'White')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (17, 'C2DAB8', 0, 'Light Green')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (18, 'FBE696', 0, 'Light Yellow')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (19, 'E4CD9E', 0, 'Tan')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (20, 'C9CAE2', 0, 'Light Violet')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (21, 'D4D5C9', 0, 'Glow In Dark Opaque')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (22, '81007B', 0, 'Purple')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (23, '2032B0', 0, 'Dark Blue-Violet')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (25, 'FE8A18', 0, 'Orange')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (26, '923978', 0, 'Magenta')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (27, 'BBE90B', 0, 'Lime')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (28, '958A73', 0, 'Dark Tan')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (29, 'E4ADC8', 0, 'Bright Pink')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (30, 'AC78BA', 0, 'Medium Lavender')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (31, 'E1D5ED', 0, 'Lavender')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (32, '635F52', 1, 'Trans-Black IR Lens')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (33, '0020A0', 1, 'Trans-Dark Blue')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (34, '84B68D', 1, 'Trans-Green')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (35, 'D9E4A7', 1, 'Trans-Bright Green')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (36, 'C91A09', 1, 'Trans-Red')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (40, '635F52', 1, 'Trans-Black')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (41, 'AEEFEC', 1, 'Trans-Light Blue')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (42, 'F8F184', 1, 'Trans-Neon Green')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (43, 'C1DFF0', 1, 'Trans-Very Lt Blue')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (45, 'DF6695', 1, 'Trans-Dark Pink')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (46, 'F5CD2F', 1, 'Trans-Yellow')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (47, 'FCFCFC', 1, 'Trans-Clear')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (52, 'A5A5CB', 1, 'Trans-Purple')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (54, 'DAB000', 1, 'Trans-Neon Yellow')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (57, 'FF800D', 1, 'Trans-Neon Orange')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (60, '645A4C', 0, 'Chrome Antique Brass')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (61, '6C96BF', 0, 'Chrome Blue')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (62, '3CB371', 0, 'Chrome Green')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (63, 'AA4D8E', 0, 'Chrome Pink')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (64, '1B2A34', 0, 'Chrome Black')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (68, 'F3CF9B', 0, 'Very Light Orange')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (69, 'CD6298', 0, 'Light Purple')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (70, '582A12', 0, 'Reddish Brown')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (71, 'A0A5A9', 0, 'Light Bluish Gray')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (72, '6C6E68', 0, 'Dark Bluish Gray')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (73, '5A93DB', 0, 'Medium Blue')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (74, '73DCA1', 0, 'Medium Green')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (75, '000000', 0, 'Speckle Black-Copper')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (76, '635F61', 0, 'Speckle DBGray-Silver')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (77, 'FECCCF', 0, 'Light Pink')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (78, 'F6D7B3', 0, 'Light Flesh')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (79, 'FFFFFF', 0, 'Milky White')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (80, 'A5A9B4', 0, 'Metallic Silver')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (81, '899B5F', 0, 'Metallic Green')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (82, 'DBAC34', 0, 'Metallic Gold')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (84, 'CC702A', 0, 'Medium Dark Flesh')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (85, '3F3691', 0, 'Dark Purple')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (86, '7C503A', 0, 'Dark Flesh')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (89, '4C61DB', 0, 'Royal Blue')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (92, 'D09168', 0, 'Flesh')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (100, 'FEBABD', 0, 'Light Salmon')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (110, '4354A3', 0, 'Violet')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (112, '6874CA', 0, 'Blue-Violet')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (114, 'DF6695', 1, 'Glitter Trans-Dark Pink')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (115, 'C7D23C', 0, 'Medium Lime')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (117, 'FFFFFF', 1, 'Glitter Trans-Clear')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (118, 'B3D7D1', 0, 'Aqua')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (120, 'D9E4A7', 0, 'Light Lime')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (125, 'F9BA61', 0, 'Light Orange')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (129, 'A5A5CB', 1, 'Glitter Trans-Purple')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (132, '000000', 0, 'Speckle Black-Silver')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (133, '000000', 0, 'Speckle Black-Gold')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (134, 'AE7A59', 0, 'Copper')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (135, '9CA3A8', 0, 'Pearl Light Gray')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (137, '7988A1', 0, 'Metal Blue')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (142, 'DCBC81', 0, 'Pearl Light Gold')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (143, 'CFE2F7', 1, 'Trans-Medium Blue')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (148, '575857', 0, 'Pearl Dark Gray')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (150, 'ABADAC', 0, 'Pearl Very Light Gray')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (151, 'E6E3E0', 0, 'Very Light Bluish Gray')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (158, 'DFEEA5', 0, 'Yellowish Green')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (178, 'B48455', 0, 'Flat Dark Gold')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (179, '898788', 0, 'Flat Silver')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (182, 'F08F1C', 1, 'Trans-Orange')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (183, 'F2F3F2', 0, 'Pearl White')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (191, 'F8BB3D', 0, 'Bright Light Orange')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (212, '9FC3E9', 0, 'Bright Light Blue')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (216, 'B31004', 0, 'Rust')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (226, 'FFF03A', 0, 'Bright Light Yellow')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (230, 'E4ADC8', 1, 'Trans-Pink')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (232, '7DBFDD', 0, 'Sky Blue')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (236, '96709F', 1, 'Trans-Light Purple')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (272, '0A3463', 0, 'Dark Blue')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (288, '184632', 0, 'Dark Green')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (294, 'BDC6AD', 1, 'Glow In Dark Trans')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (297, 'AA7F2E', 0, 'Pearl Gold')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (308, '352100', 0, 'Dark Brown')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (313, '3592C3', 0, 'Maersk Blue')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (320, '720E0F', 0, 'Dark Red')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (321, '078BC9', 0, 'Dark Azure')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (322, '36AEBF', 0, 'Medium Azure')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (323, 'ADC3C0', 0, 'Light Aqua')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (326, '9B9A5A', 0, 'Olive Green')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (334, 'BBA53D', 0, 'Chrome Gold')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (335, 'D67572', 0, 'Sand Red')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (351, 'F785B1', 0, 'Medium Dark Pink')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (366, 'FA9C1C', 0, 'Earth Orange')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (373, '845E84', 0, 'Sand Purple')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (378, 'A0BCAC', 0, 'Sand Green')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (379, '6074A1', 0, 'Sand Blue')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (383, 'E0E0E0', 0, 'Chrome Silver')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (450, 'B67B50', 0, 'Fabuland Brown')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (462, 'FFA70B', 0, 'Medium Orange')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (484, 'A95500', 0, 'Dark Orange')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (503, 'E6E3DA', 0, 'Very Light Gray')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (1000, 'D9D9D9', 0, 'Glow in Dark White')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (1001, '9391E4', 0, 'Medium Violet')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (1002, 'C0F500', 1, 'Glitter Trans-Neon Green')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (1003, '68BCC5', 1, 'Glitter Trans-Light Blue')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (1004, 'FCB76D', 1, 'Trans Flame Yellowish Orange')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (1005, 'FBE890', 1, 'Trans Fire Yellow')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (1006, 'B4D4F7', 1, 'Trans Light Royal Blue')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (1007, '8E5597', 0, 'Reddish Lilac')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (9999, '05131D', 0, '[No Color]')");
|
||||
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (494, 'D0D0D0', 0, 'Electric Contact Alloy')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (493, '656761', 0, 'Magnet')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (375, 'C1C2C1', 0, 'Rubber Light Gray')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (324, 'C40026', 0, 'Rubber Red')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (256, '212121', 0, 'Rubber Black')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (67, 'FFFFFF', 1, 'Rubber Trans Clear')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (38, 'FF800D', 1, 'Trans-Neon Orange')");
|
||||
$this->addSql("INSERT INTO color (id, rgb, transparent, name) VALUES (39, 'C1DFF0', 1, 'Trans Very Light Blue')");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
|
||||
|
||||
}
|
||||
}
|
143
app/Resources/fixtures/colors.csv
Normal file
143
app/Resources/fixtures/colors.csv
Normal file
@ -0,0 +1,143 @@
|
||||
-1,0033B2,0,Unknown
|
||||
0,05131D,0,Black
|
||||
1,0055BF,0,Blue
|
||||
2,237841,0,Green
|
||||
3,008F9B,0,Dark Turquoise
|
||||
4,C91A09,0,Red
|
||||
5,C870A0,0,Dark Pink
|
||||
6,583927,0,Brown
|
||||
7,9BA19D,0,Light Gray
|
||||
8,6D6E5C,0,Dark Gray
|
||||
9,B4D2E3,0,Light Blue
|
||||
10,4B9F4A,0,Bright Green
|
||||
11,55A5AF,0,Light Turquoise
|
||||
12,F2705E,0,Salmon
|
||||
13,FC97AC,0,Pink
|
||||
14,F2CD37,0,Yellow
|
||||
15,FFFFFF,0,White
|
||||
17,C2DAB8,0,Light Green
|
||||
18,FBE696,0,Light Yellow
|
||||
19,E4CD9E,0,Tan
|
||||
20,C9CAE2,0,Light Violet
|
||||
21,D4D5C9,0,Glow In Dark Opaque
|
||||
22,81007B,0,Purple
|
||||
23,2032B0,0,Dark Blue-Violet
|
||||
25,FE8A18,0,Orange
|
||||
26,923978,0,Magenta
|
||||
27,BBE90B,0,Lime
|
||||
28,958A73,0,Dark Tan
|
||||
29,E4ADC8,0,Bright Pink
|
||||
30,AC78BA,0,Medium Lavender
|
||||
31,E1D5ED,0,Lavender
|
||||
32,635F52,1,Trans-Black IR Lens
|
||||
33,0020A0,1,Trans-Dark Blue
|
||||
34,84B68D,1,Trans-Green
|
||||
35,D9E4A7,1,Trans-Bright Green
|
||||
36,C91A09,1,Trans-Red
|
||||
38,FF800D,1,Trans-Neon Orange
|
||||
39,C1DFF0,1,Trans Very Light Blue
|
||||
40,635F52,1,Trans-Black
|
||||
41,AEEFEC,1,Trans-Light Blue
|
||||
42,F8F184,1,Trans-Neon Green
|
||||
43,C1DFF0,1,Trans-Very Lt Blue
|
||||
45,DF6695,1,Trans-Dark Pink
|
||||
46,F5CD2F,1,Trans-Yellow
|
||||
47,FCFCFC,1,Trans-Clear
|
||||
52,A5A5CB,1,Trans-Purple
|
||||
54,DAB000,1,Trans-Neon Yellow
|
||||
57,FF800D,1,Trans-Neon Orange
|
||||
60,645A4C,0,Chrome Antique Brass
|
||||
61,6C96BF,0,Chrome Blue
|
||||
62,3CB371,0,Chrome Green
|
||||
63,AA4D8E,0,Chrome Pink
|
||||
64,1B2A34,0,Chrome Black
|
||||
67,FFFFFF,1,Rubber Trans Clear
|
||||
68,F3CF9B,0,Very Light Orange
|
||||
69,CD6298,0,Light Purple
|
||||
70,582A12,0,Reddish Brown
|
||||
71,A0A5A9,0,Light Bluish Gray
|
||||
72,6C6E68,0,Dark Bluish Gray
|
||||
73,5A93DB,0,Medium Blue
|
||||
74,73DCA1,0,Medium Green
|
||||
75,000000,0,Speckle Black-Copper
|
||||
76,635F61,0,Speckle DBGray-Silver
|
||||
77,FECCCF,0,Light Pink
|
||||
78,F6D7B3,0,Light Flesh
|
||||
79,FFFFFF,0,Milky White
|
||||
80,A5A9B4,0,Metallic Silver
|
||||
81,899B5F,0,Metallic Green
|
||||
82,DBAC34,0,Metallic Gold
|
||||
84,CC702A,0,Medium Dark Flesh
|
||||
85,3F3691,0,Dark Purple
|
||||
86,7C503A,0,Dark Flesh
|
||||
89,4C61DB,0,Royal Blue
|
||||
92,D09168,0,Flesh
|
||||
100,FEBABD,0,Light Salmon
|
||||
110,4354A3,0,Violet
|
||||
112,6874CA,0,Blue-Violet
|
||||
114,DF6695,1,Glitter Trans-Dark Pink
|
||||
115,C7D23C,0,Medium Lime
|
||||
117,FFFFFF,1,Glitter Trans-Clear
|
||||
118,B3D7D1,0,Aqua
|
||||
120,D9E4A7,0,Light Lime
|
||||
125,F9BA61,0,Light Orange
|
||||
129,A5A5CB,1,Glitter Trans-Purple
|
||||
132,000000,0,Speckle Black-Silver
|
||||
133,000000,0,Speckle Black-Gold
|
||||
134,AE7A59,0,Copper
|
||||
135,9CA3A8,0,Pearl Light Gray
|
||||
137,7988A1,0,Metal Blue
|
||||
142,DCBC81,0,Pearl Light Gold
|
||||
143,CFE2F7,1,Trans-Medium Blue
|
||||
148,575857,0,Pearl Dark Gray
|
||||
150,ABADAC,0,Pearl Very Light Gray
|
||||
151,E6E3E0,0,Very Light Bluish Gray
|
||||
158,DFEEA5,0,Yellowish Green
|
||||
178,B48455,0,Flat Dark Gold
|
||||
179,898788,0,Flat Silver
|
||||
182,F08F1C,1,Trans-Orange
|
||||
183,F2F3F2,0,Pearl White
|
||||
191,F8BB3D,0,Bright Light Orange
|
||||
212,9FC3E9,0,Bright Light Blue
|
||||
216,B31004,0,Rust
|
||||
226,FFF03A,0,Bright Light Yellow
|
||||
230,E4ADC8,1,Trans-Pink
|
||||
232,7DBFDD,0,Sky Blue
|
||||
236,96709F,1,Trans-Light Purple
|
||||
256,212121,0,Rubber Black
|
||||
272,0A3463,0,Dark Blue
|
||||
288,184632,0,Dark Green
|
||||
294,BDC6AD,1,Glow In Dark Trans
|
||||
297,AA7F2E,0,Pearl Gold
|
||||
308,352100,0,Dark Brown
|
||||
313,3592C3,0,Maersk Blue
|
||||
320,720E0F,0,Dark Red
|
||||
321,078BC9,0,Dark Azure
|
||||
322,36AEBF,0,Medium Azure
|
||||
323,ADC3C0,0,Light Aqua
|
||||
324,C40026,0,Rubber Red
|
||||
326,9B9A5A,0,Olive Green
|
||||
334,BBA53D,0,Chrome Gold
|
||||
335,D67572,0,Sand Red
|
||||
351,F785B1,0,Medium Dark Pink
|
||||
366,FA9C1C,0,Earth Orange
|
||||
373,845E84,0,Sand Purple
|
||||
375,C1C2C1,0,Rubber Light Gray
|
||||
378,A0BCAC,0,Sand Green
|
||||
379,6074A1,0,Sand Blue
|
||||
383,E0E0E0,0,Chrome Silver
|
||||
450,B67B50,0,Fabuland Brown
|
||||
462,FFA70B,0,Medium Orange
|
||||
484,A95500,0,Dark Orange
|
||||
493,656761,0,Magnet
|
||||
494,D0D0D0,0,Electric Contact Alloy
|
||||
503,E6E3DA,0,Very Light Gray
|
||||
1000,D9D9D9,0,Glow in Dark White
|
||||
1001,9391E4,0,Medium Violet
|
||||
1002,C0F500,1,Glitter Trans-Neon Green
|
||||
1003,68BCC5,1,Glitter Trans-Light Blue
|
||||
1004,FCB76D,1,Trans Flame Yellowish Orange
|
||||
1005,FBE890,1,Trans Fire Yellow
|
||||
1006,B4D4F7,1,Trans Light Royal Blue
|
||||
1007,8E5597,0,Reddish Lilac
|
||||
9999,05131D,0,[No Color]
|
|
@ -70,12 +70,6 @@ doctrine:
|
||||
naming_strategy: doctrine.orm.naming_strategy.underscore
|
||||
auto_mapping: true
|
||||
|
||||
doctrine_migrations:
|
||||
dir_name: "%kernel.root_dir%/DoctrineMigrations"
|
||||
namespace: Application\Migrations
|
||||
table_name: migration_versions
|
||||
name: Application Migrations
|
||||
|
||||
monolog:
|
||||
channels: ['loader']
|
||||
use_microseconds: false
|
||||
|
@ -16,7 +16,6 @@
|
||||
"doctrine/orm": "^2.5",
|
||||
"doctrine/doctrine-bundle": "^1.6",
|
||||
"doctrine/doctrine-cache-bundle": "^1.2",
|
||||
"doctrine/doctrine-migrations-bundle": "^1.0",
|
||||
"symfony/swiftmailer-bundle": "^2.3",
|
||||
"symfony/monolog-bundle": "^2.8",
|
||||
"symfony/polyfill-apcu": "^1.0",
|
||||
@ -36,6 +35,7 @@
|
||||
"phpunit/phpunit": "^6.1",
|
||||
"friendsofphp/php-cs-fixer": "^2.0",
|
||||
"mikey179/vfsStream": "^1.6"
|
||||
"doctrine/doctrine-fixtures-bundle": "^2.3"
|
||||
},
|
||||
"scripts": {
|
||||
"symfony-scripts": [
|
||||
|
46
src/AppBundle/DataFixtures/ORM/LoadColors.php
Normal file
46
src/AppBundle/DataFixtures/ORM/LoadColors.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace AppBundle\DataFixtures\ORM;
|
||||
|
||||
|
||||
use AppBundle\Entity\Color;
|
||||
use Doctrine\Common\DataFixtures\FixtureInterface;
|
||||
use Doctrine\Common\Persistence\ObjectManager;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
class LoadColors implements FixtureInterface, ContainerAwareInterface
|
||||
{
|
||||
/**
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
public function load(ObjectManager $manager)
|
||||
{
|
||||
$colors = fopen($this->container->getParameter('kernel.root_dir').'/Resources/fixtures/colors.csv', 'r');
|
||||
|
||||
while (!feof($colors)) {
|
||||
$line = fgetcsv($colors);
|
||||
|
||||
if ($line) {
|
||||
$color = new Color();
|
||||
$color->setId($line[0]);
|
||||
$color->setRgb($line[1]);
|
||||
$color->setTransparent($line[2]);
|
||||
$color->setName($line[3]);
|
||||
|
||||
$manager->persist($color);
|
||||
}
|
||||
}
|
||||
|
||||
fclose($colors);
|
||||
|
||||
$manager->flush();
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user