PluginProbe
MLSImport: IDX Plugin & MLS Plugin for Real Estate Listings / 7.2.1
MLSImport: IDX Plugin & MLS Plugin for Real Estate Listings v7.2.1
7.2.1 7.2 7.1.2 7.1.1 7.1 7.0.4 7.0.6 7.0.7 6.3.8 6.3.7 6.3.6 6.3.5 6.3.4 6.3.3 6.3.1 trunk 5.7.3 5.7.5 5.8.1 5.8.2 5.8.3 5.8.4 5.8.6 6.0.4 6.0.5 All 36 releases
mlsimport / enviroment / UnsupportedResoClass.php

UnsupportedResoClass.php in MLSImport: IDX Plugin & MLS Plugin for Real Estate Listings 7.2.1, at enviroment/UnsupportedResoClass.php

65 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Unsupported Provider Family result.
4 *
5 * The public Provider Family module returns this object when a saved provider
6 * type is unknown. Returning a normal result object lets every caller show the
7 * same safe error without catching exceptions or silently using Bridge rules.
8 *
9 * @package MLSImport
10 */
11
12 if ( ! defined( 'ABSPATH' ) ) {
13 exit;
14 }
15
16 /**
17 * Read-only adapter-shaped result for an unsupported saved provider type.
18 */
19 class UnsupportedResoClass extends ResoBase {
20 /** @var bool Unknown providers cannot execute Direct MLS requests. */
21 protected $direct_access_supported = false;
22
23 /** @var string The unrecognized saved provider type. */
24 private $unsupported_type;
25
26 /**
27 * Store the invalid type so the error identifies the broken configuration.
28 *
29 * @param string $unsupported_type Unrecognized provider type from saved config.
30 */
31 public function __construct( $unsupported_type ) {
32 $this->unsupported_type = (string) $unsupported_type;
33 }
34
35 /**
36 * Return the exact unrecognized type for logs and diagnostics.
37 *
38 * @return string
39 */
40 public function type() {
41 return $this->unsupported_type;
42 }
43
44 /**
45 * Report that requests cannot be made with this adapter.
46 *
47 * @return bool
48 */
49 public function supported() {
50 return false;
51 }
52
53 /**
54 * Return a stable safe error for admin screens and request callers.
55 *
56 * @return array{code:string,message:string}
57 */
58 public function error() {
59 return array(
60 'code' => 'unsupported_provider',
61 'message' => 'This MLS provider type is not supported.',
62 );
63 }
64 }
65