PHPackages                             nilportugues/filesystem-repository - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. nilportugues/filesystem-repository

ActiveLibrary[Database &amp; ORM](/categories/database)

nilportugues/filesystem-repository
==================================

FileSystem Repository implementation

3.0.0(9y ago)4156MITPHPPHP &gt;=7.0

Since Feb 7Pushed 9y agoCompare

[ Source](https://github.com/PHPRepository/php-filesystem-repository)[ Packagist](https://packagist.org/packages/nilportugues/filesystem-repository)[ Docs](http://nilportugues.com)[ RSS](/packages/nilportugues-filesystem-repository/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (7)Dependencies (4)Versions (8)Used By (0)

FileSystem Repository
=====================

[](#filesystem-repository)

[![PHP7 Tested](https://camo.githubusercontent.com/c35197a6a78ae187a4432f07436b3a0496548c14de61f171786bbb131d660747/687474703a2f2f7068702d6579652e636f6d2f62616467652f6e696c706f727475677565732f66696c6573797374656d2d7265706f7369746f72792f70687037302e737667)](https://camo.githubusercontent.com/c35197a6a78ae187a4432f07436b3a0496548c14de61f171786bbb131d660747/687474703a2f2f7068702d6579652e636f6d2f62616467652f6e696c706f727475677565732f66696c6573797374656d2d7265706f7369746f72792f70687037302e737667)[![Build Status](https://camo.githubusercontent.com/eb7eea25c8d2452c60e5ea06fa6515fec4a8f1ecb12cdc911bf127d8f1c29e3b/68747470733a2f2f7472617669732d63692e6f72672f5048505265706f7369746f72792f66696c6573797374656d2d7265706f7369746f72792e737667)](https://travis-ci.org/PHPRepository/filesystem-repository) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/dc03af99904d4893a55e11a75a836e15968b6f524a179aa2fb632e7db6e7dc02/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6e696c706f727475677565732f7068702d66696c6573797374656d2d7265706f7369746f72792f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/nilportugues/php-filesystem-repository/?branch=master) [![SensioLabsInsight](https://camo.githubusercontent.com/cf24a907716b61aa8da96594478f1cadafaf9f0df7390c76f878e270e2ff18f6/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f37363336313239362d313331392d346238332d613739612d3633383237663064373566642f6d696e692e706e673f)](https://insight.sensiolabs.com/projects/76361296-1319-4b83-a79a-63827f0d75fd) [![Latest Stable Version](https://camo.githubusercontent.com/36a135f82018e7ebe20be92f846bb9353526d19ebb6038f9f7c7b1de8009a9f7/68747470733a2f2f706f7365722e707567782e6f72672f6e696c706f727475677565732f66696c6573797374656d2d7265706f7369746f72792f762f737461626c65)](https://packagist.org/packages/nilportugues/filesystem-repository) [![Total Downloads](https://camo.githubusercontent.com/11d8a62c89209a4907dffa88dba0a07b876a0712d7214c4da9261737b4e1c482/68747470733a2f2f706f7365722e707567782e6f72672f6e696c706f727475677565732f66696c6573797374656d2d7265706f7369746f72792f646f776e6c6f616473)](https://packagist.org/packages/nilportugues/filesystem-repository) [![License](https://camo.githubusercontent.com/5d61e4c22222d9c5ed12f2b024387e77d6e5730ddbdea828c0076a2c240df986/68747470733a2f2f706f7365722e707567782e6f72672f6e696c706f727475677565732f66696c6573797374656d2d7265706f7369746f72792f6c6963656e7365)](https://packagist.org/packages/nilportugues/filesystem-repository)[![Donate](https://camo.githubusercontent.com/7b6de155df30b37b25eb5fec52f9213680c3dbf067dfb7d7e2850ac4096c7d05/68747470733a2f2f7777772e70617970616c6f626a656374732e636f6d2f656e5f55532f692f62746e2f62746e5f646f6e6174655f534d2e676966)](https://paypal.me/nilportugues)

FileSystem Repository using *[nilportugues/repository](https://github.com/nilportugues/php-repository)* as foundation.

FileSystem Repository allows you to fetch, paginate and operate with data easily without adding overhead and following good practices.

Table of Contents
=================

[](#table-of-contents)

- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Repository](#repository)
- [Data Operations](#data-operations)
    - [Fields](#fields)
    - [Filtering](#filtering)
    - [Pagination](#pagination)
        - [Pageable](#pageable)
        - [Page object](#page-object)
    - [Sorting](#sorting)
        - [Ordering](#ordering)

Features
--------

[](#features)

- **Repository pattern right from the start.**
- **All operations available from the beginning:**
    - Search the repository using PHP objects
    - Filtering is available using the Filter object.
    - Fetching certaing fields is available using the Fields Object.
    - Pagination is solved available using the Page and Pageable objects.
- **Want to change persistence layer? Provided repository alternatives are:**
    - *[InMemoryRepository](https://github.com/PHPRepository/repository)*: for testing purposes
    - *[SQL Repository](https://github.com/PHPRepository/sql-repository)*: migration to SQL databases is possible.
    - *[MongoDBRepository](https://github.com/PHPRepository/mongodb-repository)*: because your schema keeps changing
- **Caching layer required? Easily to add!**
    - Require the *[Repository Cache](https://github.com/PHPRepository/repository-cache)* package from Composer to add consistent caching to all operations.

Installation
------------

[](#installation)

Use [Composer](https://getcomposer.org) to install the package:

```
$ composer require nilportugues/filesystem-repository
```

Usage
-----

[](#usage)

```
