Giter VIP home page Giter VIP logo

analogue's Introduction

Analogue ORM

Latest Stable Version Latest Unstable Version License Build Status StyleCI

Analogue is a flexible, easy-to-use Data Mapper ORM for PHP. It provides a quick and intuitive way to query and persist custom domain objects into a SQL Database.

The project started as a fork from Eloquent by Taylor Otwell, and evolved into a fully featured Data Mapper, that sits on top of the very robust Laravel Database component. That said, Analogue is able to peacefuly coexists with its cousin in a same application (only limitation is you cannot have relationships between the two, which is a common moraly accepted behaviour in the same family...)

Analogue can be used as a standalone package, or can be transparently integrated into Laravel or Lumen via a dedicated ServiceProvider. A Silex service provider is also available.

If you're already familiar with Eloquent, a lot of the syntax is similar, so you should be up and running in no time. In fact, you may probably gain time as Analogue leverage some heavy DB tasks as synchronizing complex relationships, letting you think in term of objects and collections instead.

$files = $filesystem->files('/path/to/gallery');

$gallery = new Gallery('Trip to India');

foreach ($files as $file) {
    $photo = new Photo($file);
    $gallery->addPhoto($photo);
}

$mapper->store($gallery);

If you intend to build applications following the DDD approach, Analogue can be a great asset for you.

Check the Documentation for more details.

Features

  • Framework agnostic
  • Lazy loading
  • Eager Loading
  • Timestamps
  • Soft Deletes
  • Value Objects
  • Polymorphic Relationships
  • Dynamic Relationships
  • Cast entities to Array / Json
  • Flexible event system
  • Native multiple database connections support
  • Extendable via Plugins

Install

composer require analogue/orm

See Configuration for more information.

Changelog

Version 5.4

  • Illuminate 5.4 Compatibility.
  • Add Abillity to map DB columns that name are not equals to the name of the attribute.

Version 5.3

  • Illuminate 5.3 Compatibility.
  • Now fully support Single Table Inheritance.

Version 5.1

  • Illuminate 5.1 + 5.2 Compatibility.

Version 5.0

  • Analogue version now mirrors illuminate version.

Version 2.1.3

  • Mutator feature in base Entity class.
  • Ability to add entities to a proxy collection without lazyloading it.

Version 2.1

  • Package is now framework agnostic.
  • Now support any plain object that implements Mappable interface.
  • Introducing a MappableTrait for quick implementation.
  • Queries can now be run directly on the mapper Object.
  • Store/Delete methods now accept a array and collections as argument.
  • EntityMap are now autodected when in the same namespace as the entity.
  • Base Entity class Supports hidden attributes.
  • Many workflow related improvements.

Version 2.0

  • Laravel 5 Support.

Documentation

Check the wiki for full documentation.

Licence

This package is licensed under the MIT License.

analogue's People

Contributors

bryant1410 avatar evertt avatar graemetait avatar kalvisbuls avatar lex111 avatar maxmirazh33 avatar remicollin avatar rickycheers avatar scrutinizer-auto-fixer avatar serafimarts avatar shin1x1 avatar smallhadroncollider avatar tabennett avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.