Skip to content

eightmarq/core-bundle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EightMarq - Core bundle

Core bundle is a basic bundle for all EightMarq bundles.

Requirements

Important! PHP 8.1 is required for this bundle, because in this bundle we use typed properties feature!

Installation

composer require knplabs/doctrine-behaviors
composer require eightmarq/core-bundle

Usage

Entity

class <your-entity-name> extends BaseEntity

EightMarq\CoreBundle\Entity\BaseEntity provides basic entity functionalities:

  • $id property with getId() / setId() method
  • Timestampable behavior (KnpLabs/DoctrineBehaviors)
  • SoftDeleteable behavior (KnpLabs/DoctrineBehaviors)
  • Blameable behavior (KnpLabs/DoctrineBehaviors)

AbstractExtension

If you create a new bundle, you should use EightMarq\CoreBundle\DependencyInjection\AbstractExtension instead of using directly use Symfony\Component\DependencyInjection\Extension\Extension class.

Provides

Entity interface registration

Your entities from the bundles will be automatically added to your project.

Usage: override prepend function like below

public function prepend(ContainerBuilder $container): void
{
    $this->targetEntities[<interface_class_name>] = <entity_class_name>;

    parent::prepend($container);
}

More information: https://symfony.com/doc/current/doctrine/resolve_target_entity.html

Configuration reference

No configuration