PHP code example of laminas-api-tools / api-tools-doctrine
1. Go to this page and download the library: Download laminas-api-tools/api-tools-doctrine 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/ */
laminas-api-tools / api-tools-doctrine example snippets
use Laminas\ApiTools\Doctrine\Server\Event\DoctrineResourceEvent;
$sharedEvents = $this->getApplication()->getEventManager()->getSharedManager();
$sharedEvents->attach(
'Laminas\ApiTools\Doctrine\DoctrineResource',
DoctrineResourceEvent::EVENT_CREATE_PRE,
function(DoctrineResourceEvent $e) {
$e->stopPropagation();
return new ApiProblem(400, 'Stop API Creation');
}
);