Full Table

-key-getMark()getColor()getPrice()getId()
5PeugeotRed15505
14PeugeotGreen120014
22PeugeotBlue140022
31CitroenRed200031
45CitroenYellow180045
52CitroenBrown140052
67NissanBrown170067
71NissanGreen175071
89NissanRed150089

Find (price > 1500 and color = "Red")

-key-getMark()getColor()getPrice()getId()
5PeugeotRed15505
31CitroenRed200031
$table->find(
    ConditionBuilder::createAnd()
        ->greaterThan('price', 1500)
        ->equalTo('color',
            $database->getTable('color')
                ->findOne(['name' => 'Red'])
        )
);

Find (mark = "Citroen" and color = "Brown")

-key-getMark()getColor()getPrice()getId()
52CitroenBrown140052
$table->find([
    'color.name' => 'Brown',
    'mark.name' => 'Citroen',
]);

Find (price > 1500 or color = "Red")

-key-getMark()getColor()getPrice()getId()
5PeugeotRed15505
31CitroenRed200031
45CitroenYellow180045
67NissanBrown170067
71NissanGreen175071
89NissanRed150089
$table->find(
    ConditionBuilder::createOr()
        ->greaterThan('price', 1500)
        ->equalTo('color.name', 'Red')
);

Find (price > 1500 or color = "Red") sorted (mark ASC then price DESC)

-key-getMark()getColor()getPrice()getId()
31CitroenRed200031
45CitroenYellow180045
71NissanGreen175071
67NissanBrown170067
89NissanRed150089
5PeugeotRed15505
$table->find(
    ConditionBuilder::createOr()
        ->greaterThan('price', 1500)
        ->equalTo('color.name', 'Red')
)
    ->sort([
        'mark.name' => true,
        'price' => false,
    ]);

Find (price > 1500 or color = "Red") sorted (mark ASC then price DESC) limit (1, 3)

-key-getMark()getColor()getPrice()getId()
45CitroenYellow180045
71NissanGreen175071
67NissanBrown170067
$table->find(
    ConditionBuilder::createOr()
        ->greaterThan('price', 1500)
        ->equalTo('color.name', 'Red')
)
    ->sort([
        'mark.name' => true,
        'price' => false,
    ])
    ->limit(1, 3);