public function beforeFind(Event $event, Query $query, ArrayObject $options, $primary)
    {
        $orders = $this->_config['orders'];

        $args = [$query, $options, $primary];

        foreach ($orders as $config) {
            if ((!empty($config['callback'])
                    && call_user_func_array($config['callback'], $args)
                ) || !$query->clause('order')
            ) {
                $query->order($config['order']);
                break;
            }
        }
    }