Giter Club home page Giter Club logo

doctrine-naming-strategy's Introduction

Doctrine Naming Strategy На Русском

PHPUnit Coverage Status 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 declare(strict_types=1);
$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.

# Register CamelCaseNamingStrategy as service
services:
    Linkin\Component\DoctrineNamingStrategy\ORM\Mapping\CamelCaseNamingStrategy:
        class: Linkin\Component\DoctrineNamingStrategy\ORM\Mapping\CamelCaseNamingStrategy

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

How will the generated SQL change?

To demonstrate difference let's take association example entities from the official Doctrine documentation

Compare DefaultNamingStrategy and CamelCaseNamingStrategy

Compare

Raw SQL for different strategies

License

license

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.