protected function applyJoins($query)
    {
        foreach ($this->joins as $key => $join) {

            if (isset($this->joinTypes[$key])) {
                $joinMethod = $this->joinTypes[$key];
            } else {
                $joinMethod = 'leftJoin';
            }

            call_user_func_array([ $query, $joinMethod ], $join);
        }
    }