Skip to content

Instantly share code, notes, and snippets.

@Omranic
Last active June 25, 2016 23:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Omranic/5dde1edcf5a02095512cf29996467534 to your computer and use it in GitHub Desktop.
Save Omranic/5dde1edcf5a02095512cf29996467534 to your computer and use it in GitHub Desktop.
Active Repository
<?php
interface RepositoryContract
{
public function find($id, $columns = ['*'], $with = []);
public function findBy($attribute, $value, $columns = ['*'], $with = []);
public function findAll($columns = ['*'], $with = []);
public function paginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null);
public function findWhere(array $where, $columns = ['*'], $with = []);
public function findWhereIn($attribute, array $values, $columns = ['*'], $with = []);
public function findWhereNotIn($attribute, array $values, $columns = ['*'], $with = []);
public function firstOrCreate(array $attributes);
public function update($id, array $attributes = []);
public function delete($id);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment