# flexmls-idx/3.8.2/SparkAPI/PropertyTypes.php

Flexmls® IDX Plugin, version 3.8.2. 31 lines.

- Page: https://pluginprobe.com/plugins/flexmls-idx/3.8.2/code/SparkAPI/PropertyTypes.php
- Raw: https://pluginprobe.com/plugins/flexmls-idx/3.8.2/raw/SparkAPI/PropertyTypes.php
- Modified: 2017-02-09T16:28:42+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/flexmls-idx/3.8.2/code/SparkAPI/PropertyTypes.php#L10-L20`.

```php
<?php
namespace SparkAPI;

defined( 'ABSPATH' ) or die( 'This plugin requires WordPress' );

class PropertyTypes extends Core {

	function __construct(){
		parent::__construct();
	}

	function get_property_sub_types() {
		$response = $this->get_from_api( 'GET', 'standardfields/PropertySubType', DAY_IN_SECONDS );
		if( true == $response[ 'success' ] && array_key_exists( 'FieldList', $response[ 'results' ][ 0 ][ 'PropertySubType' ] ) ){
			return $response[ 'results' ][ 0 ][ 'PropertySubType' ][ 'FieldList' ];
		}
		return false;
	}

	function get_property_types(){
		$records = false;
		$response = $this->get_from_api( 'GET', 'propertytypes', DAY_IN_SECONDS );
		if( true == $response[ 'success' ] ){
			$records = array();
			foreach( $response[ 'results' ] as $res ){
				$records[ $res[ 'MlsCode' ] ] = $res[ 'MlsName' ];
			}
		}
		return $records;
	}
}
```
