Skip to content

Instantly share code, notes, and snippets.

<?php
namespace Drupal\example_rest\Plugin\rest\resource;
use Drupal\Core\Session\AccountProxyInterface;
use Drupal\rest\Plugin\ResourceBase;
use Drupal\rest\ResourceResponse;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Psr\Log\LoggerInterface;
name: Example Rest
type: module
description: Example module Rest service.
core: 8.x
package: Example
<?php
namespace Drupal\manage_inventory;
use Drupal\Core\Access\AccessResult;
use Drupal\Core\Entity\EntityAccessControlHandler;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Session\AccountInterface;
/**
<?php
namespace Drupal\manage_inventory\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Class InventorySettingsForm.
* @package Drupal\manage_inventory\Form
<?php
namespace Drupal\manage_inventory\Entity\Controller;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Entity\EntityListBuilder;
use Drupal\Core\Url;
/**
* Provides a list controller for content_entity_manage_inventory entity.
*
<?php
namespace Drupal\manage_inventory\Form;
use Drupal\Core\Entity\ContentEntityConfirmFormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
/**
<?php
namespace Drupal\manage_inventory\Form;
use Drupal\Core\Entity\ContentEntityForm;
use Drupal\Core\Language\Language;
use Drupal\Core\Form\FormStateInterface;
/**
<?php
/**
* @file
* Contains \Drupal\manage_inventory\Entity\Contact.
*/
namespace Drupal\manage_inventory\Entity;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Field\BaseFieldDefinition;
<?php
namespace Drupal\manage_inventory;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\user\EntityOwnerInterface;
use Drupal\Core\Entity\EntityChangedInterface;
/**
* Provides an interface defining a Inventory entity.
* @ingroup manage_inventory