Inpsyde\MultilingualPress\API\WPDBLanguages::get_languages PHP Method

get_languages() public method

Returns all languages according to the given arguments.
Since: 3.0.0
public get_languages ( array $args = [] ) : object[]
$args array Arguments.
return object[] The array with objects of all languages according to the given arguments.
    public function get_languages(array $args = [])
    {
        $args = array_merge(['conditions' => [], 'fields' => [], 'number' => 0, 'order_by' => [['field' => 'priority', 'order' => 'DESC'], ['field' => 'english_name', 'order' => 'ASC']], 'page' => 1], $args);
        $fields = $this->get_fields($args);
        $where = $this->get_where($args);
        $order_by = $this->get_order_by($args);
        $limit = $this->get_limit($args);
        $query = "SELECT {$fields} FROM {$this->table} {$where} {$order_by} {$limit}";
        $results = $this->db->get_results($query);
        return is_array($results) ? $results : [];
    }