Skip to content

Filtering collection over multiple conditions in one relation #526

@tomaskavalek

Description

@tomaskavalek

Please help, is it possible to filter over multiple conditions in one relation? How to do that?

The target is to have all the records which have atribute with ID 1 and values 35 or 37, and attribute with ID 2 and values 36 or 28.

Code bellow doesn't solve the problem – in final query is only one LEFT JOIN, so condition is always false.

$this->findBy([
	ICollection:: AND,
	[
		'prices->currency' => $crcy,
	],
	[
		ICollection:: AND,
		'values->attribute->id' => 1,
		'values->id' => [35, 37],
	],
	[
		ICollection:: AND,
		'values->attribute->name' => 2,
		'values->id' => [36, 28],
	]
]);

Is there any way to do that?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions