[TYPO3-mvc] How to avoid duplicates of valueobjects?

Ilya Kanunnikov ik at brosment.com
Mon Apr 11 20:15:20 CEST 2011


I'm working on multiple files submitting and got a problem with tags - they
are duplicated in DB and I no need that. Tag model is valueobject. Example
of how I add/attach tags to parent record:

foreach($addedFile['tags'] as $tag) {
    $tag = t3lib_div::makeInstance(Tx_MsMedia_Domain_Model_Tag, $tag);
    $file->addTag($tag);
}

Do you know any bugs/instructions for getting valueobject unique in DB. I
would prefer to avoid DB queries for checking existed objects because I
think there should be native way in extbase, but I can't find it. Please
help.

Ilya.


More information about the TYPO3-project-typo3v4mvc mailing list