Nach update auf Version 5.6 - getAttribute funktioniert nicht mehr

Vieleicht kann mir jemand helfen, die Fuktion getAttribute funktioniert so nicht mehr, danke!

 

 private function checkIfParentArticleNeedsLicense($parentArticle)
    {
        $em = $this->container->get(‘models’);
        $articleID = Shopware()->Modules()->Articles()->sGetArticleIdByOrderNumber($parentArticle);
        $article = $em->getRepository(Article::class)->findOneBy([‘id’ => $articleID]);
        $articleAttributes = $article-> getAttribute ()->getislicensearticle();
        return $articleAttributes;

getAttribute gibt es nicht mehr am Artikel

Du musst ->getMainDetail()->getAttribute machen

Hallo Shyim,

vielen Dank, jetzt kommt ein anderer Fehler? 

use \Shopware\Models\Article\Article;

class Shopware_Controllers_Frontend_ParentChildDecisionPage extends \Enlight_Controller_Action
{

    private function checkIfParentArticleNeedsLicense($parentArticle)
    {
        $em = $this->container->get(‘models’);
        $articleID = Shopware()->Modules()->Articles()->sGetArticleIdByOrderNumber($parentArticle);
        $article = $em->getRepository(Article::class)->findOneBy([‘id’ => $articleID]);
        $articleAttributes = $article->getMainDetail()->getAttribute->getislicensearticle();
        return $articleAttributes;
    }

Fehler:
Fatal error : Uncaught Error: Call to a member function getislicensearticle() on null in /home/denyukdy/www.dentoo.com/testserver/custom/plugins/TMFPluginParentChildConnection/Controllers/Frontend/ParentChildDecisionPage.php:19 Stack trace: #0 /home/denyukdy/www.dentoo.com/testserver/custom/plugins/TMFPluginParentChildConnection/Controllers/Frontend/ParentChildDecisionPage.php(144): Shopware_Controllers_Frontend_ParentChildDecisionPage->checkIfParentArticleNeedsLicense(‘SW10471’) #1 /home/denyukdy/www.dentoo.com/testserver/engine/Library/Enlight/Controller/Action.php(192): Shopware_Controllers_Frontend_ParentChildDecisionPage->indexAction() #2 /home/denyukdy/www.dentoo.com/testserver/engine/Library/Enlight/Controller/Dispatcher/Default.php(478): Enlight_Controller_Action->dispatch(‘indexAction’) #3 /home/denyukdy/www.dentoo.com/testserver/engine/Library/Enlight/Controller/Front.php(228): Enlight_Controller_Dispatcher_Default->dispatch(Object(Enlight_Controller_Request_RequestHttp), Object(Enlight_Controller_Response_Respon in  /home/denyukdy/www.dentoo.com/testserver/custom/plugins/TMFPluginParentChildConnection/Controllers/Frontend/ParentChildDecisionPage.php  on line  19

$article->getMainDetail()->getAttribute()->getislicensearticle()

Danke!