Yii2 AR class 是否可以检查,两个对象是否有一个 link?

Does Yii2 AR class can check, does two objects has a link?

在 Kohana 中被执行为 $user->has('departments', array('id' => $dep->id_department))

我在 Yii2 中看不到相同的东西

$customer = Customer::findOne(123);

$order = new Order();
$order->save(); // now its id is - 33

$customer->link('orders', $order); // let think relation is via table

现在我想检查我的 $customer 是否链接了这个对象 Order::find(33)

我发现这样做丑陋的方式

$customer ->getOrders()->where(['id' => 33])->exists();

是否有像 Kohana 中那样更短更漂亮 的解决方案?

Kohana 方式:

$customer ->has('orders', ['id' => 33])