2017 © Pedro Peláez
 

library doctrine-behaviors

Integration of KnpLabs/DoctrineBehaviors to Nette\DI

image

zenify/doctrine-behaviors

Integration of KnpLabs/DoctrineBehaviors to Nette\DI

  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 8 Forks
  • 1 Open issues
  • 33 Versions
  • 3 % Grown

The README.md

Doctrine Behaviors

Build Status Quality Score Code Coverage Downloads total Latest stable, (*1)

Port of KnpLabs/DoctrineBehaviors to Nette DI, (*2)

Supported behaviors:, (*3)

  • Blameable
  • Geocodable
  • Loggable
  • Sluggable
  • SoftDeletable
  • Translatable
  • Timestampable
  • Tree

For implementation to entities, check tests., (*4)

Install

Via Composer:, (*5)

$ composer require zenify/doctrine-behaviors

Register extensions you need in config.neon:, (*6)

extensions:
    translatable: Zenify\DoctrineBehaviors\DI\TranslatableExtension
    - Zenify\DoctrineBehaviors\DI\TimestampableExtension

Usage

Translatable

Setup your translator locale callback in config.neon:, (*7)

translatable:
    currentLocaleCallable: [@Translator, getLocale]

Place trait to your entity:, (*8)

class Article
{

    use Knp\DoctrineBehaviors\Model\Translatable\Translatable;
    // returns translated property for $article->getTitle() or $article->title
    use Zenify\DoctrineBehaviors\Entities\Attributes\Translatable;

}

And its translation entity:, (*9)

class ArticleTranslation
{

    use Knp\DoctrineBehaviors\Model\Translatable\Translation;

    /**
     * @ORM\Column(type="string")
     * @var string
     */
    public $title;

}

For deeper knowledge see test for:, (*10)

Timestampable

Place trait to your entity to ad $createdAt and $updatedAt properties:, (*11)

class Article
{

    use Knp\DoctrineBehaviors\Model\Timestampable\Timestampable;

}

Testing

composer check-cs
vendor/bin/phpunit

Contributing

Rules are simple:, (*12)

  • new feature needs tests
  • all tests must pass
  • 1 feature per PR

We would be happy to merge your feature then!, (*13)

The Versions

13/03 2016

v2.4.0

2.4.0.0

Integation of KnpLabs/DoctrineBehaviors to Nette\DI

  Sources   Download

MIT

The Requires

 

The Development Requires

19/01 2016

v2.3.0

2.3.0.0

Integation of KnpLabs/DoctrineBehaviors to Nette\DI

  Sources   Download

MIT

The Requires

 

The Development Requires

03/11 2015

v2.2.2

2.2.2.0

Integation of KnpLabs/DoctrineBehaviors to Nette\DI

  Sources   Download

MIT

The Requires

 

The Development Requires

11/09 2015

v2.2.1

2.2.1.0

Integation of KnpLabs/DoctrineBehaviors to Nette\DI

  Sources   Download

MIT

The Requires

 

The Development Requires

01/07 2014

v1.0.7

1.0.7.0

Port of KnpLabs/DoctrineBehaviors to Nette

  Sources   Download

MIT

The Requires

 

21/06 2014

v1.0.6

1.0.6.0

Port of KnpLabs/DoctrineBehaviors to Nette

  Sources   Download

MIT

The Requires

 

21/06 2014

v1.0.5

1.0.5.0

Port of KnpLabs/DoctrineBehaviors to Nette

  Sources   Download

MIT

The Requires

 

21/06 2014

v1.0.4

1.0.4.0

Port of KnpLabs/DoctrineBehaviors to Nette

  Sources   Download

MIT

The Requires

 

21/06 2014

v1.0.3

1.0.3.0

Port of KnpLabs/DoctrineBehaviors to Nette

  Sources   Download

MIT

The Requires

 

21/06 2014

v1.0.2

1.0.2.0

Port of KnpLabs/DoctrineBehaviors to Nette

  Sources   Download

MIT

The Requires

 

21/06 2014

v1.0.1

1.0.1.0

Port of KnpLabs/DoctrineBehaviors to Nette

  Sources   Download

MIT

The Requires

 

21/06 2014

v1.0.0

1.0.0.0

Port of KnpLabs/DoctrineBehaviors to Nette

  Sources   Download

MIT

The Requires