PHPackages                             unb-libraries/custom-entity - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. unb-libraries/custom-entity

ActiveDrupal-module[Utility &amp; Helpers](/categories/utility)

unb-libraries/custom-entity
===========================

A collection of Drupal modules to ease working with custom entities.

15.3k↓50%1PHP

Since Jan 12Pushed 2y ago5 watchersCompare

[ Source](https://github.com/unb-libraries/custom-entity)[ Packagist](https://packagist.org/packages/unb-libraries/custom-entity)[ RSS](/packages/unb-libraries-custom-entity/feed)WikiDiscussions 9.x-1.x Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

unb-libraries/custom-entity [![GitHub license](https://camo.githubusercontent.com/007e108601aaca821a9ef99de77c60b3d736323e01de263c1e610d4d334dc9d0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f756e622d6c69627261726965732f646f636b65722d65696e6261756d)](https://github.com/unb-libraries/lib.unb.ca/blob/prod/LICENSE)
========================================================================================================================================================================================================================================================================================================================================================

[](#unb-librariescustom-entity-)

A Drupal module improving the developer experience of working with ***custom entities***.

Installation
------------

[](#installation)

The module is a composer package hosted on packagist and can be installed by running

```
composer require unb-libraries/custom-entity
```

or by adding it to your project's `composer.json` file:

```
{
  "require": {
    "unb-libraries/custom-entity": "dev-9.x-1.x"
  }
}
```

Enable the module by running

```
drush en custom_entity
```

or via the Drupal UI under `/admin/modules`.

Usage
-----

[](#usage)

The module enhances Drupal by providing implementations of:

### Access handlers

[](#access-handlers)

The `Drupal\custom_entity\Entity\Access\EntityAccessControlHandler` dynamically grants or denies access to an entity whether a user has permission of the form `  entities`.

For example, in order for a user to get permission to `edit` a `node` entity, the user would need to have the `edit node entities` permission assigned to them.

In order to activate the access control handler, set it in an entity's type definition:

```
