1. Go to this page and download the library: Download bauer01/unimapper-nette 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/ */
namespace YourApp\ApiModule\Presenter;
class EntityPresenter extends \UniMapper\Nette\Api\Presenter
{
...
}
namespace YourApp\ApiModule\Presenter;
class EntityPresenter extends \UniMapper\Nette\Api\Presenter
{
public function actionYourCustomMethod($id)
{
...
}
}
class SomeRepository extends \UniMapper\Repository
{
private $requestFactory;
public function __construct(
\UniMapper\Connection $connection,
\UniMapper\Nette\Api\ICustomRequestFactory $requestFactory
) {
parent::__construct($connection);
$this->requestFactory;
}
public function getSomethingFromApi()
{
$this->requestFactory()->setResource("apiResource")->setAction("custom")->send();
}
}