[TYPO3-mvc] Repository does not save added objects

Valentin Zickner typo3 at joan.coderworks.de
Thu Feb 28 15:21:54 CET 2013


Hi Philipp,

maybe you should use dependency injection or the object manager instead 
of makeInstance.

Regards,

Valentin

On 28.02.2013 15:10, Philipp wrote:
> Hey. Following code is placed in a static method of a serviceclass.
>
> $repository =
> \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Vendor\\Events\\Domain\\Repository\\IrregularOccasionRepository');
>
>
> $dummy = new \Pixelpoint\Events\Domain\Model\IrregularOccasion(
> new \DateTime(),
> new \DateTime(),
> $occasion->getTimeFrom(),
> $occasion->getTimeTo(),
> $occasion->getRegionalObject(),
> $table,
> $id
> );
>
> $repository->add($dummy);
>
> My repository doesnt store the dummy in the database...
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
>


More information about the TYPO3-project-typo3v4mvc mailing list