2017 © Pedro Peláez
 

library repository

Simple implementation of Active Repository

image

guardianslabs/repository

Simple implementation of Active Repository

  • Saturday, September 9, 2017
  • by mustafah15
  • Repository
  • 2 Watchers
  • 3 Stars
  • 19 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Repository

Latest Version on Packagist ![Software License][ico-license] ![Quality Score][ico-code-quality] Total Downloads, (*1)

Repository Is A very simple implementation for Active Repository, (*2)

Install

Via Composer, (*3)

``` bash $ composer require guardiansLabs/repository, (*4)


## Usage create your own repository that extend the our ActiveRepository and inject your model ``` php use App\User; use GuardiansLabs\Repository\Repositories\ActiveRepository; class UserRepository extends ActiveRepository { public function __construct() { $this->model = new User(); } }

Avilavle methods

``` php, (*5)

public function setModel(Model $model);

public function getModel();

/**
 * @return Collection
 */
public function findAll();

/**
 * @param $itemId
 * @return Collection
 */
public function findItemById($itemId);

/**
 * @param array $data
 * @return Collection
 */
public function createNew(array $data);

/**
 * @param $itemId
 * @param array $data
 * @return mixed
 */
public function update($itemId, array $data);

/**
 * @param $itemId
 * @return mixed
 */
public function delete($itemId);

/**
 * @param array $where
 * @param array $columns
 * @internal param array $attributes
 * @return Collection
 */
public function findWhere(array $where, $columns = ['*']);

/**
 * @param $column
 * @param $values
 * @throws RepositoryException
 * @return Collection
 */
public function findWhereIn($column, $values);

```, (*6)

Change log

Please see CHANGELOG for more information what has changed recently., (*7)

Contributing

Any Pull Requests are Welcome, (*8)

Credits

License

The MIT License (MIT). Please see License File for more information., (*9)

The Versions

09/09 2017

dev-master

9999999-dev https://github.com/GuardiansLabs/Repository

Simple implementation of Active Repository

  Sources   Download

MIT

The Requires

 

by mustafa hussain

repository guardianslabs

09/09 2017

0.2.1

0.2.1.0 https://github.com/GuardiansLabs/Repository

Simple implementation of Active Repository

  Sources   Download

MIT

The Requires

 

by mustafa hussain

repository guardianslabs

11/05 2017

0.2

0.2.0.0 https://github.com/GuardiansLabs/Repository

Simple implementation of Active Repository

  Sources   Download

MIT

The Requires

  • php ~7.0|~7.1

 

by mustafa hussain

repository guardianslabs

29/04 2017

0.1

0.1.0.0 https://github.com/GuardiansLabs/Repository

Simple implementation of Active Repository

  Sources   Download

MIT

The Requires

  • php ~7.0|~7.1

 

by mustafa hussain

repository guardianslabs

28/04 2017

0.0.0

0.0.0.0 https://github.com/GuardiansLabs/Repository

Simple implementation of Active Repository

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.1

 

The Development Requires

by mustafa hussain

repository guardianslabs

28/04 2017

dev-scrutinizer-patch-1

dev-scrutinizer-patch-1 https://github.com/GuardiansLabs/Repository

Simple implementation of Active Repository

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.1

 

The Development Requires

by mustafa hussain

repository guardianslabs