Skip to content

johnkrovitch/repository

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Generic Repository

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;
    }
}

About

Generic repository for Doctrine ORM

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages