2017 © Pedro Peláez
 

library database

Avalon Database Component

image

avalon/database

Avalon Database Component

  • Sunday, March 25, 2018
  • by Nirix
  • Repository
  • 2 Watchers
  • 0 Stars
  • 796 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 1 % Grown

The README.md

Avalon Database

The Avalon database package makes use of the Doctrine [Database Abstraction Layer][1], it is essentially a small wrapper around it that provides a simple "Model" system., (*1)

This is not an ORM., (*2)

Models

Models are a representation of a database row, you can select, update and delete rows with models., (*3)

Selecting rows into models

When using a model to fetch data, it will automatically be placed into a model for you., (*4)

class Article extends Avalon\Database\Model {}

$articles = Article::where('is_published = :is_published')
    ->andWhere('user_id = :user_id')
    ->setParameter('is_published', 1)
    ->setParameter('user_id', 5)
    // Normally with Doctrine and PDO you would call `->execute()`,
    // you could do that here, but it would return the statement.
    //
    // If you simply call `fetchAll()` you will get an array of `Article` models.
    ->fetchAll();

foreach ($articles as $article) {
    echo $article->title;
}

The Versions

25/03 2018

dev-master

9999999-dev

Avalon Database Component

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Avatar Nirix

orm database avalon