2017 © Pedro Peláez
 

symfony-bundle sequence-bundle

Nicolassing sequence bundle allow you to create sequential number (eg reference, invoice number, ...)

image

nicolassing/sequence-bundle

Nicolassing sequence bundle allow you to create sequential number (eg reference, invoice number, ...)

  • Thursday, January 25, 2018
  • by nicolassing
  • Repository
  • 1 Watchers
  • 1 Stars
  • 58 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

[WIP] This bundle is under development. It's not suitable for production., (*1)

This bundle is heavily inspired by awesome Sylius Work ;), (*2)

INSTALLATION via Composer

composer require nicolassing/sequence-bundle

CONFIGURATION

Register the bundle:, (*3)

<?php
// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        // ...
        new Nicolassing\SequenceBundle\NicolassingSequenceBundle(),
    );
    // ...
}

Create your Sequence class:, (*4)

<?php
// src/AppBundle/Entity/Sequence.php

namespace AppBundle\Entity;

use Nicolassing\SequenceBundle\Model\Sequence as BaseSequence;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="sequence")
 */
class Sequence extends BaseSequence
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @return mixed
     */
    public function getId()
    {
        return $this->id;
    }
}

Configure the bundle:, (*5)

# app/config/config.yml
nicolassing_sequence:
    sequence_class: AppBundle\Entity\Sequence

USAGE

TESTS

If you want to run tests, please check that you have installed dev dependencies., (*6)

./vendor/bin/phpunit

The Versions