-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #147 from mitelg/ntr/master/fix-issues
Fix model creation; fixes #108
- Loading branch information
Showing
4 changed files
with
25 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a3719b4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mitelg In my understanding $model in 'src/Extensions/Shopware/PluginCreator/template/current/Controllers/Backend.tpl' requires an absolute path as no namespace is defined?
a3719b4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ray-magini the backendModel should be a class name including the namespace.
does this not work for you?
a3719b4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mitelg Not sure if we are talking about the same thing. I am referring to the $model variable, in my understanding this needs to be an absolute path as it was before (independent of the notation) so:
protected $model = '\<?= $configuration->name; ?>\Models\<?= $configuration->backendModel; ?>';
or
protected $model = \<?= $configuration->name; ?>\Models\<?= $configuration->backendModel; ?>::class;
a3719b4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mitelg Probably I got your comment now. In my tests the
$configuration->backendModel
is not absolute when I use the command:bin/sw plugin:create --haveBackend --backendModel=MyPlugin --haveApi --haveModels MyPlugin
a3719b4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about something like this?
--backendModel=MyPlugin\Models\MyPlugin
a3719b4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you don't set the Parameter
--backendModel
the program will suggest you a model name