PHPackages                             riesenia/cakephp-fetchable - 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. riesenia/cakephp-fetchable

ActiveCakephp-plugin[Database &amp; ORM](/categories/database)

riesenia/cakephp-fetchable
==========================

CakePHP ORM plugin for fetching entities from cache

v3.0.1(7mo ago)032.7k↓28%MITPHPPHP &gt;=8.0CI failing

Since Sep 26Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/riesenia/cakephp-fetchable)[ Packagist](https://packagist.org/packages/riesenia/cakephp-fetchable)[ RSS](/packages/riesenia-cakephp-fetchable/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (9)Dependencies (6)Versions (12)Used By (0)

Fetchable behavior for CakePHP
==============================

[](#fetchable-behavior-for-cakephp)

[![Build Status](https://camo.githubusercontent.com/dd253241f67f773b8d099ecca9932d64bb5de9e3d104cf15c0f6bedbb7341468/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f72696573656e69612f63616b657068702d666574636861626c652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/riesenia/cakephp-fetchable)[![Latest Version](https://camo.githubusercontent.com/93092e704f8c92453627fc0bad9a69e7ac24312c5f0ddb52d04bd17990da55e9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72696573656e69612f63616b657068702d666574636861626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/riesenia/cakephp-fetchable)[![Total Downloads](https://camo.githubusercontent.com/99710e4669534a0a31bebfc070dad9c7597226c3642f9c174b03fedf4cab9297/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72696573656e69612f63616b657068702d666574636861626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/riesenia/cakephp-fetchable)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

This plugin is for CakePHP 4.x and contains behavior that handles fetching entities from cache / memory storage. Relevant for tables that contain moderate number of rows and are used commonly in many parts of application.

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

[](#installation)

Using composer

```
composer require riesenia/cakephp-fetchable

```

Usage
-----

[](#usage)

This behavior is suitable for tables that contain moderate number of rows and are used commonly in many parts of application. Fetchable checks if they are already cached and also stores them in memory using `Configure` class. This lowers the number of database queries for them.

```
class StatusesTable extends Table
{
    public function initialize(array $config)
    {
        parent::initialize($config);

        $this->addBehavior('Fetchable.Fetchable', [
            // can use custom finder
            'finder' => 'active',
            // cache config
            'cache' => 'statuses_cache',
            // can contain another data
            'contain' => ['StatusProperties'],
            // if i.e. status name is translatable
            'key' => function ($name) {
                return $name . '-' . I18n::getLocale();
            }
        ]);
    }
}

// fetch all active statuses
$this->Statuses->fetch();
```

Configuration options:
----------------------

[](#configuration-options)

- *finder* - finder to use to get entities. Defaults to "all".
- *cache* - cache config to use. Defaults to "default".
- *contain* - set related entities that will be fetched.
- *key* - key used for *Cache* and *Configure* calls. Can be set to callable (i.e. for *I18n* dependend data).

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance65

Regular maintenance activity

Popularity27

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~251 days

Recently: every ~204 days

Total

10

Last Release

214d ago

Major Versions

v1.0.1 → v2.0.02019-10-16

v1.1.2 → v3.0.02025-12-02

PHP version history (2 changes)v1.1.0PHP &gt;=7.1

v3.0.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/40c7ed7cfaebeddae57ac4a376c8f21df56dd2f38821b7ba92ea1312ef8020c8?d=identicon)[riesenia](/maintainers/riesenia)

---

Top Contributors

[![segy](https://avatars.githubusercontent.com/u/1355459?v=4)](https://github.com/segy "segy (13 commits)")

---

Tags

ormcakephpcachefetch

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/riesenia-cakephp-fetchable/health.svg)

```
[![Health](https://phpackages.com/badges/riesenia-cakephp-fetchable/health.svg)](https://phpackages.com/packages/riesenia-cakephp-fetchable)
```

###  Alternatives

[josegonzalez/cakephp-upload

CakePHP plugin to handle file uploading sans ridiculous automagic

5461.4M11](/packages/josegonzalez-cakephp-upload)[muffin/trash

Adds soft delete support to CakePHP ORM tables.

881.5M11](/packages/muffin-trash)[muffin/webservice

Simplistic webservices for CakePHP

88196.6k14](/packages/muffin-webservice)[riesenia/cakephp-duplicatable

CakePHP ORM plugin for duplicating entities (including related entities)

51408.2k4](/packages/riesenia-cakephp-duplicatable)[admad/cakephp-sequence

Sequence plugin for CakePHP to maintain ordered list of records

45518.5k7](/packages/admad-cakephp-sequence)[muffin/slug

Slugging support for CakePHP ORM

38278.1k5](/packages/muffin-slug)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
