[TYPO3-mvc] problem with extbase

Christoph Moeller typo3v4mvc at linie.net
Wed Apr 29 10:44:58 CEST 2015


Dear List-Members,

new to this list, i want to discuss my problem with an own extension 
using the Newsrepository from GeorgRinger.
I try to fetch the news for one category with the follwing lines (shortend):
---start
namespace Myvendor\Myextension\Controller;
class AjaxController extends 
\TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
    /**
      * newsRepository
      *
      * @var \Tx_News_Domain_Repository_NewsRepository
      * @inject
      */
     protected $newsRepository;
   ...
     public function findNewsByCat($cat) {
         $query = $this->newsRepository->createQuery();
         $query->matching(
                 $query->logicalAnd(
                         $query->contains('categories', $cat),
                         $query->equals('archive', 0)
                 )
         );
         return $query->execute();
     } // findNewsByCat
}
--- end
my problem is, that on a first call after clearing all caches there is 
an error meaning, that the property 'categories' is not a column in the 
news-model, which is definately wrong.
if i list the news-entries first (with Georgs Extension), ajax-calls to 
my function are fullfilled correctlý.

Does anybody have experience with this an can give a hint?
is there an init to be called in front of using Tx_News?

Thank you very much!
Chris


More information about the TYPO3-project-typo3v4mvc mailing list