Skip to content
Snippets Groups Projects

#3420994 Convert RestResource plugin discovery to attributes

7 files
+ 115
45
Compare changes
  • Side-by-side
  • Inline
Files
7
@@ -3,6 +3,8 @@
namespace Drupal\dblog\Plugin\rest\resource;
use Drupal\Core\Database\Database;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\rest\Attribute\RestResource;
use Drupal\rest\Plugin\ResourceBase;
use Drupal\rest\ResourceResponse;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
@@ -10,15 +12,14 @@
/**
* Provides a resource for database watchdog log entries.
*
* @RestResource(
* id = "dblog",
* label = @Translation("Watchdog database log"),
* uri_paths = {
* "canonical" = "/dblog/{id}"
* }
* )
*/
#[RestResource(
id: "dblog",
label: new TranslatableMarkup("Watchdog database log"),
uri_paths: [
"canonical" => "/dblog/{id}",
]
)]
class DbLogResource extends ResourceBase {
/**
Loading