2017 © Pedro Peláez
 

symfony-bundle doctrine-repository-bundle

Symfony njr03304 DoctrineRepositoryBundle

image

njr03304/doctrine-repository-bundle

Symfony njr03304 DoctrineRepositoryBundle

  • Saturday, September 17, 2016
  • by njr03304
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Installation

Currently, this project just includes a single trait to use in a Doctrine repository., (*1)

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:, (*2)

$ composer require njr03304/doctrine-repository-bundle

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation., (*3)

Usage

namespace AppBundle\Repository;

use njr03304\DoctrineRepositoryBundle\Repository\Traits\FindAndCreateTrait;

class TagRepository extends \Doctrine\ORM\EntityRepository
{
    use FindAndCreateTrait;
}
$entity = $em->getRepository('AppBundle:Tag')->findByElseCreate(array('name' => 'example'));

$entity will now be and instance of AppBundle\Entity\Tag with a name of 'example', either from the DB or a new instance ready to be saved to the DB., (*4)

The Versions

17/09 2016

dev-master

9999999-dev

Symfony njr03304 DoctrineRepositoryBundle

  Sources   Download

MIT

The Requires

 

by Nate Russell

doctrine repository trait

17/09 2016

dev-develop

dev-develop

Symfony njr03304 DoctrineRepositoryBundle

  Sources   Download

MIT

The Requires

 

by Nate Russell

doctrine repository trait