PHPackages                             linkorb/context - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. linkorb/context

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

linkorb/context
===============

Context: Rich in-memory datastructure

v1.1.0(7y ago)0221MITPHPCI failing

Since Oct 23Pushed 6y ago2 watchersCompare

[ Source](https://github.com/linkorb/context)[ Packagist](https://packagist.org/packages/linkorb/context)[ Docs](https://github.com/linkorb/context)[ RSS](/packages/linkorb-context/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Context
=======

[](#context)

> NOTE: This Context library is now deprecated in favor of the new [Sage](https://github.com/linkorb/sage) library

Context is a library + toolkit to manipulate extractions of larger databases for conversion, transformation and presentation.

Definitions
-----------

[](#definitions)

- **Context**: A Context is like a small in-memory database that can be traversed as a graph. it contains one or more Tables. It should not contain an entire copy of a traditional database, instead it is designed to only contain a cohesive set of data about one particular object (i.e. a customer with all of it's data, a business with all of it's people, processes, policies, etc, or a project with all of it's cards, milestones and stakeholders).
- **Table**: Analogue to a database table, it contains one or more columns, and a RecordSet containing the actual data
- **Column**: Analogue to a database column, it describes the contents of the data. A regular (literal) column defines types (int, string, date, etc), requirements (required, allow null, etc) and textual description. You can also add special columns that can be used to reference other records based on a key. This allows you to create 1-to-n and n-to-1 references.
- **RecordSet**: an array of Records. There can be multiple implementations of a recordset interface. At the moment there's only the in-memory ArrayRecordSet implementation.
- **Record**: Star of the show: it comparse to a traditional database record, but contains rich functionality by binding it tightly to it's table and column definitions. An in-memory Record can be accessed both as an array (`$user['name']`) and as an object (`$user->name`) and supports many-to-1 relations to other tables (i.e. `$user->country->flagImageUrl`), as well as 1-to-many relations (i.e. `foreach($user->addresses as $address) echo $address->city`

Use-cases
---------

[](#use-cases)

- Rapid applicationn development: You don't need to model objects (with getters/setters/etc) in order to work with them. Just define schema (in yaml) and load raw data (from json, yaml, arrays, etc for example) and you're ready to traverse the context and the records within it.
- Complex medical record mapping/conversion: Use a context to load all records related to a patient, then easily traverse it through it relations.
- Structured Documentation: Model information according to it's domain, then load it into a Contect and use templates to traverse the information.
- GraphQL datastore: A context is in essence a Graph. A context can therefor be used to generate a GraphQL server which can be used by other applications to easily query the context in a format of their choosing.
- Natural user interface/email/view generation: Simply define a context into a view, and loop over it with any template language such as twig, handlebars, mustache, etc. No further controller logic required.

Naming conventions
------------------

[](#naming-conventions)

Context does not really care about the naming used for tables, columns etc. But for consistency we recommend the following:

- Table names: `PascalCase`
- Column names: `camelCase`

This (as opposed to `snake-case` or `kebab_case`) will keep your code look natural when used in scripts and templates.

License
-------

[](#license)

MIT (see [LICENSE.md](LICENSE.md))

Brought to you by the LinkORB Engineering team
----------------------------------------------

[](#brought-to-you-by-the-linkorb-engineering-team)

[![](https://camo.githubusercontent.com/62fb66b034de7ea7fca9fd9776424b5348daa76ef8622caf92c2f7622003e5ef/687474703a2f2f7777772e6c696e6b6f72622e636f6d2f642f6d6574612f74696572312f696d616765732f6c696e6b6f7262656e67696e656572696e672d6c6f676f2e706e67)](https://camo.githubusercontent.com/62fb66b034de7ea7fca9fd9776424b5348daa76ef8622caf92c2f7622003e5ef/687474703a2f2f7777772e6c696e6b6f72622e636f6d2f642f6d6574612f74696572312f696d616765732f6c696e6b6f7262656e67696e656572696e672d6c6f676f2e706e67)
Check out our other projects at [linkorb.com/engineering](http://www.linkorb.com/engineering).

Btw, we're hiring!

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

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 ~10 days

Total

2

Last Release

2798d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1db66b320db18b8036ea68211b7d8a39e7c6da97e6fd29f59a50380ebb69d0bb?d=identicon)[joostfaassen](/maintainers/joostfaassen)

---

Top Contributors

[![joostfaassen](https://avatars.githubusercontent.com/u/411113?v=4)](https://github.com/joostfaassen "joostfaassen (10 commits)")

---

Tags

Contextlinkorb

### Embed Badge

![Health badge](/badges/linkorb-context/health.svg)

```
[![Health](https://phpackages.com/badges/linkorb-context/health.svg)](https://phpackages.com/packages/linkorb-context)
```

###  Alternatives

[johndoh/contextmenu

Adds context menus with common tasks to various parts of Roundcube

10680.0k1](/packages/johndoh-contextmenu)[kartik-v/yii2-nav-x

An extended bootstrap Nav widget for Yii 2 with submenu drilldown.

27586.4k6](/packages/kartik-v-yii2-nav-x)[kartik-v/yii2-dropdown-x

An extended bootstrap 3.x dropdown widget for Yii 2 with submenu drilldown.

16875.5k6](/packages/kartik-v-yii2-dropdown-x)[bisight/etl

BiSight ETL: Extract, Transform, Load toolkit

114.1k](/packages/bisight-etl)

PHPackages © 2026

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