[TYPO3-english] Filter child object in an extbase query

Richard Davies richard at ocular.co.nz
Wed Feb 4 21:07:52 CET 2015


Hi Eric,

I'm not sure this is possible - the autoloader loads the object as it is
AFAICT. If you want to get the first image from an object you can create a
method on the object with
if($this->images->count()){
      $this->images->rewind();
      return $this->images->current();
}

Richard

On 4 February 2015 at 23:22, Eric Chavaillaz <eric at hemmer.ch> wrote:

> Hi list,
>
> I have a repository of product. Each product can have no, one or some
> images in an MM relation (Images are sets with FAL).
> Is it possible to limit the number of images attached to my product in a
> custom query?
>
> I want for example, all my products but only with the first image (if
> exist) attached.
>
> Thanks
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english
>


More information about the TYPO3-english mailing list