| 1 |
<?php |
| 2 |
/** |
| 3 |
* SparkResoClass — RESO provider adapter for the Spark (FBS) MLS data source. |
| 4 |
* |
| 5 |
* Owns Spark identity, Stored timestamp formatting, and saved-token login. |
| 6 |
* |
| 7 |
* @package MLSImport |
| 8 |
*/ |
| 9 |
// Abort if the file is accessed directly outside of WordPress. |
| 10 |
if ( ! defined( 'ABSPATH' ) ) { |
| 11 |
exit; // Exit if accessed directly |
| 12 |
} |
| 13 |
|
| 14 |
/* |
| 15 |
* To change this license header, choose License Headers in Project Properties. |
| 16 |
* To change this template file, choose Tools | Templates |
| 17 |
* and open the template in the editor. |
| 18 |
*/ |
| 19 |
|
| 20 |
/** |
| 21 |
* Description of SparkResoClass |
| 22 |
* |
| 23 |
* @author cretu |
| 24 |
*/ |
| 25 |
|
| 26 |
class SparkResoClass extends ResoBase { |
| 27 |
|
| 28 |
/** @var string Stable provider type saved for Spark. */ |
| 29 |
protected $provider_type = 'spark'; |
| 30 |
|
| 31 |
/** @var bool Spark sends its saved bearer token unchanged. */ |
| 32 |
protected $direct_uses_stored_token = true; |
| 33 |
|
| 34 |
// The theme importer instance this provider delegates to. |
| 35 |
public $theme_importer; |
| 36 |
|
| 37 |
/** |
| 38 |
* Store the theme importer reference for later delegation. |
| 39 |
* |
| 40 |
* @param object $theme_importer The active theme importer instance. |
| 41 |
*/ |
| 42 |
public function __construct( $theme_importer ) { |
| 43 |
// Keep the theme importer for provider-specific handling. |
| 44 |
$this->theme_importer = $theme_importer; |
| 45 |
} |
| 46 |
|
| 47 |
/** Format Spark sync times with seconds and a UTC suffix. */ |
| 48 |
protected function format_stored_timestamp( $value ) { |
| 49 |
return $this->format_utc_timestamp( $value, false, true ); |
| 50 |
} |
| 51 |
} |
| 52 |
|