johnkrovitch/repository

Generic repository for Doctrine ORM

Installs: 7 464

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 1

Open Issues: 2

pkg:composer/johnkrovitch/repository

v2.1 2020-10-19 19:53 UTC

This package is auto-updated.

Last update: 2025-09-29 02:49:56 UTC


README

Generic repository for Doctrine ORM. It returns Collection instead of simple arrays and add a save() method to preserve the Repository pattern.

It requires that you install Doctrine in your application to work. If you want built-in Doctrine, you can use the orm-pack.

Installation

composer require johnkrovitch/repository

Usage

<?php

namespace App\Repository;

use App\Entity\Article;
use JK\Repository\AbstractRepository;
use Doctrine\Common\Collections\Collection;

class ArticleRepository extends AbstractRepository
{    
    public function getEntityClass(): string
    {
        return Article::class;
    }
}