PHP code example of westonwatson / realtag

1. Go to this page and download the library: Download westonwatson/realtag library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

westonwatson / realtag example snippets




namespace Example\RealTagImplementation;

use westonwatson\realtag\RealTagHelper;

class RealTagUsage
{
    const MY_API_TOKEN = 'bqJNaoN98hNx/wDFDcZUEjkdsnKJN87Y8BBH8D8SKzoyQ5iCHyzg==';

    /**
     * @var bool
     */
    private $devMode = false;

    /**
     * @var RealTagHelper
     */
    private $realtag;

    /**
     * @var \stdClass
     */
    private $response;

    /**
     * RealTagUsage constructor.
     *
     * @param bool $devMode
     */
    public function __construct($devMode = false)
    {
        $this->realtag = new RealTagHelper(self::MY_API_TOKEN, $devMode);
    }

    public function getHomeEquityInfo()
    {
        $this->realtag->setProperty([
            "FullName"     => "Barack Obama",
            "AddressLine1" => "1600 Pennsylvania Ave., NW",
            "City"         => "Washington",
            "State"        => "DC",
            "Zip"          => "20500",
            "ExternalID"   => "change20500",
        ]);
    }

    public function showRoomCount()
    {
        echo "This property has {$this->realtag->Bedrooms} bedrooms and {$this->realtag->Bedrooms} bathrooms.\n";
    }

    public function showMortgageTerm()
    {
        echo "The owner of this property pays an estimated \${$this->realtag->MortgagePayment}, {$this->realtag->MortgageTerm} times a year.\n";
    }
}

$realtagUsage = new RealTagUsage(true);
$realtagUsage->getHomeEquityInfo();
$realtagUsage->showMortgageTerm();
$realtagUsage->showRoomCount();