Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagephp
class MyModule extends RegistrarModule {
...
	public function checkAvailability($domain, $module_row_id = null)
    {
        $row = $this->getModuleRow($module_row_id);
        $api = $this->getApi(...);

		// Check if the domain is available (this is dependent on the module's API, omitted here)
		$domain = $api->checkDomain($domain);

		return isset($domain->availability) ? $domain->availability : false;
	}
...
}

...

Code Block
languagephp
class MyModule extends RegistrarModule {
...
    public function getExpirationDate($service, $format = 'Y-m-d H:i:s')
    {
        $domain = $this->getServiceDomain($service);
        $module_row_id = $service->module_row_id ?? null;

        $row = $this->getModuleRow($module_row_id);
        $api = $this->getApi(...);

		// Get the domain information (this is dependent on the module's API, omitted here)
		$domain = $api->getDomain($domain);

		return date(strtotime($domain->expirationDate), $format);
	}
...
}

...