[TYPO3-mvc] Query object and Joins

Jochen Rau jochen.rau at typoplanet.de
Wed Mar 17 20:12:11 CET 2010


Hi Dmitri.

On 17.03.10 18:30, Dmitri Pisarev wrote:
> Hi!
> I'm still on my way discovering extbase, this time I got to Query object...
>
> I have an object Tariff which has a property service of type Service,
> which has a property type of type Servicetype. So I need to select all
> tariffs of certain type.
> Normally I would create a join for that.

Give

public function findByClientAndType($client,$type) {
	$query = $this->createQuery();
	$query->matching(
		$query->logicalAnd(
			$query->equals('service.type', $type),
			$query->equals('client', $client)
		);
	return $query->execute();
}

a try.

Regards
Jochen



More information about the TYPO3-project-typo3v4mvc mailing list