Hallo,
wir entwickeln im Moment ein Plugin welches eigene Models verwendet. Associations sind definiert und die Models bereits in der DB.
Das Problem ist, das Speichern, eines Models nicht hinbekomme.
Ich hab das im Moment so gemacht:
$t = Shopware()->Models()->createQueryBuilder();
// Get the entity manager
$entityManager = $this->getEntityManager();
$step = new \Shopware\CustomModels\SwagVinylKonfigurator\Step();
$step->setOptions("{}");
$step->setTitle("TestTitle");
$step->setDescription("Desc");
$entityManager->presist($step);
$entityManager->flush();
Fatal error: Uncaught Error: Call to undefined method Shopware\Components\Model\ModelManager::presist() in /home/vagrant/www/shopware/engine/Shopware/Plugins/Local/Frontend/SwagVinylKonfigurator/Controllers/Frontend/Vinylconfigurator.php on line 28
Schnipsel aus der Step Class:
/**
* @ORM\OneToMany(targetEntity="Option", mappedBy="step")
*/
private $options;
Bitten höflichst um Hilfe.
mfg