PHP code example of mglaman / drupal-entity-enhancements

1. Go to this page and download the library: Download mglaman/drupal-entity-enhancements 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/ */

    

mglaman / drupal-entity-enhancements example snippets




declare(strict_types=1);

namespace Drupal\mymodule\Entity;

use Drupal\Core\Entity\ContentEntityBase;
use Drupal\user\EntityOwnerInterface;

/**
 * @\EntityEnhancements\Annotation\Model(
 *  id = "my_custom_entity",
 *  owner_entity_access = true,
 *  admin_ui_routes = false,
 * )
 */
final class MyCustomEntity extends ContentEntityBase implements EntityOwnerInterface {