All Projects → wolfy-j → lodm

wolfy-j / lodm

Licence: MIT license
ODM with inheritance and OOP composition for Laravel 5+

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to lodm

derivejs
DeriveJS is a reactive ODM - Object Document Mapper - framework, a "wrapper" around a database, that removes all the hassle of data-persistence by handling it transparently in the background, in a DRY manner.
Stars: ✭ 54 (+145.45%)
Mutual labels:  odm
d3-radial-axis
A radial implementation of the D3 axis component
Stars: ✭ 23 (+4.55%)
Mutual labels:  spiral
app-keeper
Skeleton Application on Spiral Framework: Keeper Admin Panel
Stars: ✭ 38 (+72.73%)
Mutual labels:  spiral
petstore
A simple skeleton to build api's based on the chubbyphp-framework, mezzio (former zend-expressive) or slim.
Stars: ✭ 34 (+54.55%)
Mutual labels:  odm
moongoon
An object-document mapper for MongoDB. 🌙
Stars: ✭ 41 (+86.36%)
Mutual labels:  odm
mongu
🌱 Yet another Python Object-Document Mapper on top of PyMongo. It's lightweight, intuitive to use and easy to understand.
Stars: ✭ 15 (-31.82%)
Mutual labels:  odm
jobs
RoadRunner: Background PHP workers, Queue brokers
Stars: ✭ 59 (+168.18%)
Mutual labels:  spiral
DoctrineMongoODMModule
Laminas Module for Doctrine MongoDB ODM
Stars: ✭ 83 (+277.27%)
Mutual labels:  odm
PyODM
A Python SDK for adding aerial image processing capabilities to your applications 🔌
Stars: ✭ 70 (+218.18%)
Mutual labels:  odm
spiral-docker
Hassle-free access to the SPIRAL agent via Docker
Stars: ✭ 18 (-18.18%)
Mutual labels:  spiral
jsonOdm
A JSON ODM (object document mapper) for JavaScript to use on the server or in the browser.
Stars: ✭ 95 (+331.82%)
Mutual labels:  odm
php-mongo-migrator
Migrations of MongoDB. Part of @PHPMongoKit
Stars: ✭ 29 (+31.82%)
Mutual labels:  odm
monogram
Aspect-oriented layer on top of the MongoDB Node.js driver
Stars: ✭ 76 (+245.45%)
Mutual labels:  odm
glextrusion
OpenGL 3D extrusion library
Stars: ✭ 27 (+22.73%)
Mutual labels:  spiral
spiki
A spiral inductor footprint generator for Kicad
Stars: ✭ 42 (+90.91%)
Mutual labels:  spiral
mars
Mars - ODM Framework for MongoDB (MongoDB ODM Java )
Stars: ✭ 35 (+59.09%)
Mutual labels:  odm
Ming
MongoDB ODM (Object Document Mapper) with Unit of Works, IdentityMap, Relations and Mongo-In-Memory implementation
Stars: ✭ 19 (-13.64%)
Mutual labels:  odm
Galaxy-Renderer
A Program for modelling a rotating galaxy based on the density wave theory.
Stars: ✭ 136 (+518.18%)
Mutual labels:  spiral
lounge
Simple Mongoose-inspired ODM for Couchbase.
Stars: ✭ 27 (+22.73%)
Mutual labels:  odm
marpat
A class-based ES6 ODM for Mongo-like databases.
Stars: ✭ 18 (-18.18%)
Mutual labels:  odm

ODM with inheritance and OOP composition for Laravel 5+

Latest Stable Version License Build Status Scrutinizer Code Quality Coverage Status

Full Documentation | CHANGELOG

LODM module is intended to bring the Spiral ODM component functionality into your Laravel applications. This component provides the ability to manage your MongoDB data in an OOP way using your models compositions and aggregations.

Installation

Package installation can be performed using the simple composer command $ composer require wolfy-j/lodm.

To include ODM functionality in your application, you have to register the service provider Spiral\LODM\Laravel\ODMServiceProvider and CLI command Spiral\LODM\Commands\SchemaUpdate in the app.php configure and ConsoleKernel accordingly.

The module provides two configuration files which describe the class location directories (by default whole application), the set of connected MongoDB databases (ODM does not use any of Laravel's database functionality) and options that can simplify document creation.

Documentation

Examples

class User extends Document
{
  const SCHEMA = [
    '_id'            => \MongoId::class,
    'name'           => 'string',
    'email'          => 'string',
    'balance'        => 'float',
    'timeRegistered' => \MongoDate::class,
    'tags'           => ['string'],
    'profile'        => Profile::class,

    //Aggregations
    'posts'          => [
        self::MANY => Post::class,
        ['userId' => 'self::_id']
    ]
  ];
}
protected function indexAction()
{
    $u = new User();
    $u->name = 'Anton';
    $u->email = '[email protected]';
    $u->balance = 99;
    $u->save();

    dump($u);
}
protected function indexAction(string $id, UsersRepository $users)
{
    $user = $users->findByPK($id);
    if (empty($user)) {
        throw new NotFoundException('No such user');
    }

    dump($user);
}
$user = User::findOne();
$user->profile->biography = 'some bio';
$user->profile->facebookUID = 2345678;

$user->sessions->solidState(false);
$user->sessions->push(new Session([
    'timeCreated' => new \MongoDate(),
    'accessToken' => 'newrandom'
]));

Issues

Please do not open issue tickets in this github project unless they are related to the integration process. Use Primary Respository for ODM related issues.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].