"MyCustomCatalogApi" class
.../MyCustomCatalogApi.php
<?php
/**
* Class MyCustomCatalogApi
*/
class MyCustomCatalogApi extends \PCT\CustomCatalog\API\Base
{
/**
* Run
* {@inheritdoc}
* (is mandatory by interface)
*/
public function run()
{
print('Executed API: '.$this->id);
// create a backup record
if($this->backup)
{
$this->createBackup();
}
}
}
The public function run() is mandatory for any API class that extends the \PCT\CustomCatalog\API\Base class.
It is recommended to extend the
\PCT\CustomCatalog\API\Baseclass for any main API class. The base class provides many prebuilt methods to rely on when building your own api.
Reference
class
\PCT\CustomCatalog\API\Basepct_customelements_plugin_customcatalog/PCT/CustomCatalog/API/Base.phpinterface
\PCT\CustomCatalog\Interfaces\ApiInterfacepct_customelements_plugin_customcatalog/PCT/CustomCatalog/Interfaces/ApiInterface.php