adrenalinkin/doctrine-naming-strategy

Custom Doctrine ORM naming strategy

v1.0.1 2019-04-13 16:06 UTC

This package is auto-updated.

Last update: 2020-09-17 23:14:35 UTC


README

Latest Stable Version Total Downloads

Introduction

Component contains Doctrine CamelCase naming strategy.

Installation

Open a command console, enter your project directory and execute the following command to download the latest stable version of this component:

    composer require adrenalinkin/doctrine-naming-strategy

This command requires you to have Composer install globally.

Usage

For registration new naming strategy you should use manual from the official Doctrine documentation Implementing a NamingStrategy.

<?php

$namingStrategy = new \Linkin\Component\DoctrineNamingStrategy\ORM\Mapping\CamelCaseNamingStrategy();
/** @var \Doctrine\ORM\Configuration $configuration */
$configuration->setNamingStrategy($namingStrategy);

In that case, when you use Doctrine as part of the Symfony Framework - you should look into appropriated part of the DoctrineBundle documentation: Configuration Reference.

doctrine:
    orm:
        naming_strategy: Linkin\Component\DoctrineNamingStrategy\ORM\Mapping\CamelCaseNamingStrategy

Register CamelCaseNamingStrategy in the service container

License

license