Skip to content

Add drupal console generator command.#38

Open
Jaesin wants to merge 11 commits into8.x-1.xfrom
console-ceb
Open

Add drupal console generator command.#38
Jaesin wants to merge 11 commits into8.x-1.xfrom
console-ceb

Conversation

@Jaesin
Copy link
Copy Markdown
Owner

@Jaesin Jaesin commented Jan 27, 2016

Fixes #6

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still dislike that option names, it doesn't tell you that this is related with bundles at all, IMHO

@Jaesin
Copy link
Copy Markdown
Owner Author

Jaesin commented Jan 27, 2016

It's a straight copy of the console generate:entity:config command except I needed to use a custom generator.

Unfortunately I couldn't just subclass the original command, I had to duplicate it just to set a different generator.

@Jaesin
Copy link
Copy Markdown
Owner Author

Jaesin commented Jan 27, 2016

https://github.com/hechoendrupal/DrupalConsole/blob/master/src/Command/Generate/EntityConfigCommand.php

This command works for this use case but it adds files we don't need.

It would be possible to combine the two commands and use only one generator.

@Jaesin
Copy link
Copy Markdown
Owner Author

Jaesin commented Feb 19, 2016

@dawehner, @arlina-espinoza Should we bring the console command into the CEB module? We could put the template files in templates/console or something like that.

@jmolivas
Copy link
Copy Markdown

@Jaesin I will take a look at this in order to have it ready to merge.

// Use the generator to create the entity files from the template files.
$this
->getGenerator()
->generate($module, $entity_name, $entity_class, $label, $bundle_entity_name);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should also check whether this is an existing entity or not.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants