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

get_where() private method

Returns the according WHERE string for all valid conditions included in the given arguments.
private get_where ( array $args ) : string
$args array Arguments.
return string The according WHERE string for all valid conditions included in the given arguments.
    private function get_where(array $args)
    {
        if (!empty($args['conditions'])) {
            $conditions = array_filter((array) $args['conditions'], function ($condition) {
                return $this->is_array_with_valid_field($condition) && (empty($condition['compare']) || in_array($condition['compare'], $this->comparison_operators, true)) && !empty($condition['value']);
            });
            if ($conditions) {
                $conditions = array_map(function (array $condition) {
                    return $this->db->prepare("{$condition['field']} {$condition['compare']} {$this->fields[$condition['field']]}", $condition['value']);
                }, $conditions);
                return 'WHERE ' . implode(' AND ', $conditions);
            }
        }
        return '';
    }