2017 © Pedro Peláez
 

library repoman

Lightweight repository pattern implementation

image

3ev/repoman

Lightweight repository pattern implementation

  • Thursday, May 14, 2015
  • by 3ev
  • Repository
  • 3 Watchers
  • 0 Stars
  • 403 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 3 % Grown

The README.md

Repoman

Lightweight repository pattern interfaces and implementations., (*1)

See this article for a description of the repository pattern in Laravel., (*2)

Installation

$ composer require "3ev/repoman:~1.0"

Usage

Repoman provides a basic interface for a repository. You can implement it yourself, or leverage one of the supplied implementations. You can extend the interface for your own specific repository classes., (*3)

See the phpdoc in the source files for information on the API and errors., (*4)

Basic implementation

<?php
namespace Entity\Repositories;

use Tev\Repoman\Repositories\RepositoryInterface;

class Repository implements RepositoryInterface
{
    public function getAll()
    {
        // ...
    }

    public function chunk($size, $callback)
    {
        // ...
    }

    public function find($id)
    {
        // ...
    }

    public function create(array $data)
    {
        // ...
    }

    public function update($id, array $data)
    {
        // ...
    }

    public function delete($id)
    {
        // ...
    }
}

Eloquent

<?php
namespace Entity\Repositories\Eloquent;

use Entity\Models\ExampleModel;
use Tev\Repoman\Repositories\Eloquent\Repository;

class ExampleModelRepository extends Repository
{
    public function __construct()
    {
        $this->model = new ExampleModel;
    }
}

License

MIT, (*5)

The Versions

14/05 2015

dev-master

9999999-dev https://github.com/3ev/repoman

Lightweight repository pattern implementation

  Sources   Download

MIT

The Requires

  • php >= 5.4

 

The Development Requires

laravel repository eloquent pattern

14/05 2015

v1.0.0

1.0.0.0 https://github.com/3ev/repoman

Lightweight repository pattern implementation

  Sources   Download

MIT

The Requires

  • php >= 5.4

 

The Development Requires

laravel repository eloquent pattern