Download the PHP package fivesqrd/atlas-foundation without Composer
On this page you can find all versions of the php package fivesqrd/atlas-foundation. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package atlas-foundation
Atlas Data Mapper
Atlas is an open source data mapper implementation for PHP.
Atlas creates barebones models for your project with minimal effort, allowing you to start working with them quickly. Extending or customising functionality is possible, but can wait until it is required.
The framework offers the following features:
- Minimal scaffolding required to create new models
- Easily expose business logic query layer
- Reduced application wide ripples from schema changes
- Automatic read/write routing
- Protection against SQL injection attacks
- RDBMS abstraction
Use Cases
Persisting a new user:
Fetching an instance of the user entity by primary key:
Access properties using default getters:
Persisting changes to the user model using default setters:
Querying user model business layer:
Optimised queries for simple operations like counts:
Extending Model Classes
Access properties using custom getters:
Persisting changes using custom setters:
Using named queries for consistent results:
Adding to named queries on the fly:
Performing operations on collections:
Implementation
Each model consists of a set of classes. Each class extends a super class, to allow new models to be created with minimal effort.
Below is an example what a project with 3 models might look like
Sample mapper classs
Sample entity class
Using Canvas
The atlas repo ships with a script to quickly create boilerplate classes when a new model needs to be added. See https://github.com/fivesqrd/atlas-canvas
Install and Setup
Install
Via composer
Config
Add the following config to your project:
Bootstrap from MVC
Atlas can be bootstrapped from within your MVC framework by passing the Proxy class to your controllers/views via a plugin or helper:
A Laravel 5 specific package is available here: https://github.com/fivesqrd/atlas-laravel