Ich glaube, du ziehst das ganze falsch auf...

1.) Repositories lassen sich prima injizieren:

/**
* @var \TYPO3\JobsDfu\Domain\Repository\OccupationcategoryRepository
* @inject
*/
protected $occupationcategoryRepository;

Das setzt voraus, das du ein solches Repository auch besitzt.

Dann kannst du mit $this->occupationcategoryRepository->find* dein Repo
abfragen.

2.) Kein makeInstance für einfache Klassen. Benutze 
$newCat = new \TYPO3\JobsDfu\Domain\Model\Occupationcategory();
$newCat->setName('hallo');

Schau dir mal die Flow Doku, oder das Extbase Buch auf forge an, um dich
mit den grundlegenden Paradigmen vertraut zu machen. Ich glaube, du hast
grundsätzliche Probleme beim Gebrauch.

Zitat von arianesardinas <asardi...@gmx.de>:

hm...

ich habe versucht das objekt zu  instanziieren und zwar so:

$repository =

\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('\TYPO3\JobsDfu\Domain\Model\Occupationcategory');

aber ich bekomme ein error: Fatal error: Class
'\\TYPO3\JobsDfu\Domain\Model\Occupationcategory' not found meine ganze
action sieht so aus jetzt:

public function newAction(\TYPO3\JobsDfu\Domain\Model\Occupationcategory
$newOccupationcategory = NULL) {

$repository =

\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('\TYPO3\JobsDfu\Domain\Model\Occupationcategory');

$repository ->:setProperty($newOccupationcategory, 'name', 'hallo');

}
es geht auch nicht, jemand eine idee?
_______________________________________________
TYPO3-german mailing list

TYPO3-german@lists.typo3.orghttp://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german
_______________________________________________
TYPO3-german mailing list
TYPO3-german@lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german

Antwort per Email an