[TYPO3-german] Extbase - Cannot redeclare class...
JCL - Johannes C. Laxander
jc at laxander.com
Sat May 10 12:24:21 CEST 2014
Hallo Thomas,
danke das scheint geholfen zu haben, zumindest habe ich jetzt einen andern / neuen Fehler ;-)
Ich melde mich ggf. wieder hier...
Gruß, Johannes.
> -----Ursprüngliche Nachricht-----
> Von: typo3-german-bounces at lists.typo3.org
> [mailto:typo3-german-bounces at lists.typo3.org] Im Auftrag von
> Thomas Nussbaumer
> Gesendet: Samstag, 10. Mai 2014 11:59
> An: typo3-german at lists.typo3.org
> Betreff: Re: [TYPO3-german] Extbase - Cannot redeclare class...
>
> Hallo Johannes
>
> Verwende im Controller Dependency Injection:
> /**
> * @var Tx_ScCruisePlan_Domain_Repository_CruiseRepository
> * @inject
> */
> protected $cruiseRepository;
>
> public function listAction() {
> $this->view->assign('cruises',
> $this->$cruiseRepository->findBySelectedCriteria($this->settings));
> }
>
> Liebe Grüsse. Thomas
>
> Am 09.05.2014 15:55, schrieb JCL - Johannes C. Laxander:
> > Hallo,
> >
> > ich schreibe gerade an einer Extension unter TYPO3 /
> Extbase 4.7, habe aber noch wenig Erfahrung in der
> Extension-Programmierung und weiß deshalb nicht was die
> Ursache für diese Fehlermeldung ist:
> >
> > Fatal error: Cannot redeclare class
> > Tx_ScCruisePlan_Repository_CruiseRepository in
> >
> /.../ext/sc_cruise_plan/Classes/Domain/Repository/CruiseReposi
> tory.php
> > on line 92
> >
> > Ich verstehe, dass eine erneute Deklaration / Instanzierung
> (?) der Klasse nicht möglich ist. Aber aus dem Code heraus
> erkennich nicht wo das passiert, bzw. wie ich es richtig machen muss.
> >
> > Im Controller habe ich folgenden Code:
> >
> > public function listAction() {
> > $cruiseRepository =
> t3lib_div::makeInstance('Tx_ScCruisePlan_Domain_Repository_Cru
> iseRepository');
> > $this->view->assign('cruises',
> > $this->findBySelectedCriteria($this->settings));
> > }
> >
> >
> > Der Code meiner Repository-Klasse sieht so aus:
> >
> > class Tx_ScCruisePlan_Repository_CruiseRepository extends
> > Tx_Extbase_Persistence_Repository {
> >
> > public function findBySelectedCriteria($settings) {
> >
> > $query = $this->createQuery();
> > $constraints = array();
> >
> > $constraints[] =
> $query->greaterThan('cruiseStartDate', time());
> > ...
> > $query->matching($query->logicalAnd($constraints));
> > return $query->execute();
> > }
> > }
> >
> > Was mache ich falsch?
> >
> > Gruß, Johannes.
> >
>
> _______________________________________________
> TYPO3-german mailing list
> TYPO3-german at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german
>
More information about the TYPO3-german
mailing list