Skip to content

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

Abstract Data Layer

This is an example of a nice way to abstract your data layer. The example is using Aura\Sql (and so should you).

You will notice the Model never touches the database...that is the Repositories' job.

Example Usage

<?php

require 'vendor/autoload.php';

$connectionFactory = new Aura\Sql\ConnectionFactory;
$connection = $connectionFactory->newInstance('mysql', [
	'host' => 'localhost',
	'port' => '3306',
	'dbname' => 'foo',
], 'foo', 'bar');

$users = new Example\User\UserRepository($connection);
var_dump($users->getById(1));

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages