# Controllers\_Backend und sArticles()-&gt;sGetArticleById()

**URL:** <https://forum.shopware.com/t/controllers-backend-und-sarticles-gt-sgetarticlebyid/11236>\
**Category:** Shopware 3.5\
**Tags:** programming\
**Created:** [28. Januar 2013 um 16:21 UTC](https://forum.shopware.com/t/controllers-backend-und-sarticles-gt-sgetarticlebyid/11236 "2013-01-28T16:21:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pino](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/pino/32/14373_2.png) [@pino](https://forum.shopware.com/u/pino)\
**Post date:** [28. Januar 2013 um 16:21 UTC](https://forum.shopware.com/t/controllers-backend-und-sarticles-gt-sgetarticlebyid/11236/1 "2013-01-28T16:21:48Z")

</div>

hi, ich stell gerade fest, dass Shopware\_Controllers\_Backend die folgende methode nicht ausführt: `Shopware()-\>Modules()-\>Articles()-\>sGetArticleById($id)` [quote]Resource “Shop” not found failure in Enlight\Bootstrap.php on line 261[/quote] wie kann ich sGetArticleById() ausführen? [code]\<?php class Shopware\_Controllers\_Backend\_MyArticleById extends Shopware\_Controllers\_Backend\_ExtJs {  
/\*\*  
\* this function is called initially and extends the standard template directory  
\* @return void  
\*/  
public function init() {  
$this-\>View()-\>addTemplateDir(dirname(\_\_FILE\_\_) . “/Views/”); parent::init(); } /\*\* \* index action is called if no other action is triggered \* @return void \*/ public function indexAction() { $article = Shopware()-\>Modules()-\>Articles()-\>sGetArticleById(6); self::diePhp($article); } public function diePhp($v) { $str = print\_r($v, true); die(’

```
'.$str.'

```

'); } } [/code]

---

<div class="post-metadata">

**Author:** ![ecomai](https://avatars.discourse-cdn.com/v4/letter/e/8e8cbc/32.png) [@ecomai](https://forum.shopware.com/u/ecomai)\
**Post date:** [28. Januar 2013 um 16:41 UTC](https://forum.shopware.com/t/controllers-backend-und-sarticles-gt-sgetarticlebyid/11236/2 "2013-01-28T16:41:35Z")

</div>

Das müsste Articles statt sArticles sein: ` Shopware()-\>Modules()-\>Articles()-\>sGetArticleById($articleId);`

---

<div class="post-metadata">

**Author:** ![pino](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/pino/32/14373_2.png) [@pino](https://forum.shopware.com/u/pino)\
**Post date:** [28. Januar 2013 um 16:48 UTC](https://forum.shopware.com/t/controllers-backend-und-sarticles-gt-sgetarticlebyid/11236/3 "2013-01-28T16:48:27Z")

</div>

das geht leider auch nicht. // edit der code oben wurde angepasst.

---

<div class="post-metadata">

**Author:** ![bui\_ak](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@bui\_ak](https://forum.shopware.com/u/bui_ak)\
**Post date:** [28. Januar 2013 um 22:27 UTC](https://forum.shopware.com/t/controllers-backend-und-sarticles-gt-sgetarticlebyid/11236/4 "2013-01-28T22:27:57Z")

</div>

die methoden aus sArticles sind a) meist nur fürs frontend geeignet, und b) teils deprecated, und fliegen hoffentlich in 4.1.x raus. in sGetArticleById() wird auch geschaut ob der artikel für den aktuellen store verfügbar ist u.ä. der aktuelle store ist im backend nicht unbedingt definiert, desshalb die exception. ausserdem kann jedes beliebige plugin sich per hook oder filter-event in die methode einklinken und deinem plugin gehörig in die suppe spucken. um an die artikeldaten zu kommen hältst du dich am besten an [http://wiki.shopware.de/Selektierung-vo … 9\_487.html](http://wiki.shopware.de/Selektierung-von-Daten%5C_detail%5C_879%5C_487.html) oder bastelst dir dein eigenes sql zusammen.

---

<div class="post-metadata">

**Author:** ![pino](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/pino/32/14373_2.png) [@pino](https://forum.shopware.com/u/pino)\
**Post date:** [29. Januar 2013 um 12:19 UTC](https://forum.shopware.com/t/controllers-backend-und-sarticles-gt-sgetarticlebyid/11236/5 "2013-01-29T12:19:48Z")

</div>

danke, war auch schon drauf und dran mir die abfrage selbst zusammen zu stellen. was ich nun auch tun werde.
