All Projects → deprecated-packages → DoctrineBehaviors

deprecated-packages / DoctrineBehaviors

Licence: MIT license
[DEPRECATED]

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to DoctrineBehaviors

Datagrid
💪 DataGrid for Nette Framework: filtering, sorting, pagination, tree view, table view, translator, etc
Stars: ✭ 224 (+1936.36%)
Mutual labels:  doctrine, nette
nette-oauth2-server-doctrine
Integration of The League of Extraordinary Packages' OAuth 2.0 Server into Nette Framework- Kdyby/Doctrine storage implementation
Stars: ✭ 13 (+18.18%)
Mutual labels:  doctrine, nette
Postgresql For Doctrine
PostgreSQL enhancements for Doctrine. Provides support for advanced data types (json, jssnb, arrays), text search, array operators and jsonb specific functions.
Stars: ✭ 181 (+1545.45%)
Mutual labels:  doctrine
resources
Client-side resources for Nette Framework.
Stars: ✭ 22 (+100%)
Mutual labels:  nette
Sonata Doctrine Extensions
Doctrine2 behavioral extensions
Stars: ✭ 239 (+2072.73%)
Mutual labels:  doctrine
Grav
Modern, Crazy Fast, Ridiculously Easy and Amazingly Powerful Flat-File CMS powered by PHP, Markdown, Twig, and Symfony
Stars: ✭ 13,067 (+118690.91%)
Mutual labels:  doctrine
dockerfiles
🐳 Dockerfiles for Nette Framework. Nette in Docker. (@nette)
Stars: ✭ 15 (+36.36%)
Mutual labels:  nette
Doctrinefixturesbundle
Symfony integration for the doctrine/data-fixtures library
Stars: ✭ 2,174 (+19663.64%)
Mutual labels:  doctrine
doctrine-phpstorm-meta
PhpStorm meta data for expected arguments completion.
Stars: ✭ 35 (+218.18%)
Mutual labels:  doctrine
examples
🎓 Examples demonstrating the Nette Framework.
Stars: ✭ 89 (+709.09%)
Mutual labels:  nette
Doctrine Bridge
Provides integration for Doctrine with various Symfony components.
Stars: ✭ 2,800 (+25354.55%)
Mutual labels:  doctrine
Core
Zikula Core Framework
Stars: ✭ 213 (+1836.36%)
Mutual labels:  doctrine
coding-standard
Nette Coding Standard code checker & fixer
Stars: ✭ 37 (+236.36%)
Mutual labels:  nette
Msgphp
Reusable domain layers. Shipped with industry standard infrastructure.
Stars: ✭ 182 (+1554.55%)
Mutual labels:  doctrine
railt.org
A website
Stars: ✭ 23 (+109.09%)
Mutual labels:  doctrine
Pagerfanta
Pagination library for PHP applications with support for several data providers
Stars: ✭ 175 (+1490.91%)
Mutual labels:  doctrine
Foundry
A model factory library for creating expressive, auto-completable, on-demand dev/test fixtures with Symfony and Doctrine.
Stars: ✭ 216 (+1863.64%)
Mutual labels:  doctrine
Core
🧿 Bolt 4 core
Stars: ✭ 243 (+2109.09%)
Mutual labels:  doctrine
nette-minified
[DISCONTINUED] Minified version of Nette Framework.
Stars: ✭ 16 (+45.45%)
Mutual labels:  nette
symbok-bundle
Symfony annotations bundle
Stars: ✭ 50 (+354.55%)
Mutual labels:  doctrine

Doctrine Behaviors

Build Status Quality Score Code Coverage Downloads total Latest stable

Port of KnpLabs/DoctrineBehaviors to Nette DI

Supported behaviors:

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

For implementation to entities, check tests.

Install

Via Composer:

$ composer require zenify/doctrine-behaviors

Register extensions you need in config.neon:

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

Usage

Translatable

Setup your translator locale callback in config.neon:

translatable:
	currentLocaleCallable: [@Translator, getLocale]

Place trait to your entity:

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:

class ArticleTranslation
{
	
	use Knp\DoctrineBehaviors\Model\Translatable\Translation;

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

}

For deeper knowledge see test for:

Timestampable

Place trait to your entity to ad $createdAt and $updatedAt properties:

class Article
{
	
	use Knp\DoctrineBehaviors\Model\Timestampable\Timestampable;

}

Testing

composer check-cs
vendor/bin/phpunit

Contributing

Rules are simple:

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

We would be happy to merge your feature then!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].