mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
30 lines
717 B
PHP
30 lines
717 B
PHP
<?php
|
|
|
|
namespace App\Controller;
|
|
|
|
use App\Entity\Connector;
|
|
use App\Entity\User;
|
|
use Doctrine\Common\Collections\Collection;
|
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|
use Symfony\Component\Routing\Attribute\Route;
|
|
|
|
class ConnectorController extends AbstractController
|
|
{
|
|
#[Route(
|
|
path: '/api/connectors',
|
|
name: 'connector_get_all_mine',
|
|
defaults: [
|
|
'_api_resource_class' => Connector::class,
|
|
'_api_operation_name' => 'get_all_mine',
|
|
],
|
|
methods: ['GET']
|
|
)]
|
|
public function getConnector(): Collection
|
|
{
|
|
/** @var User $user */
|
|
$user = $this->getUser();
|
|
|
|
return $user->getConnectors();
|
|
}
|
|
}
|