# orderBy

{% hint style="info" %}
Using those additional parameters we need to adjust our `where` conditions
{% endhint %}

The adjustments are already introduced [here](https://jls-organization-3.gitbook.io/projecthyper/features/quickstart/parameters/where).

**Note:**

```php
// From
$condition = array('id' => 1);
// To
$condition = array(
    'where' => array(
        'id' => 1
    )
)
// We can also use the other conditions
$condition = array(
    'where' => array(
        'id' => array(
            'in' => array(1,2,3)
        )
    )
)
```

**Usage:**

Just add the `order` object in the root object

```php
// Using Order by
$condition = array(
    'where' => array(
        'id' => array(
            'in' => array(1,2,3)
        )
    ),
    'order' => array(
        'id' => 'DESC'
    )
)

// or multiple order by
$condition = array(
    'where' => array(
        'id' => array(
            'in' => array(1,2,3)
        )
    ),
    'order' => array(
        'id' => 'DESC',
        'created_at' => 'ASC'
    )
)


$db->news->find($condition);
```
