PHPackages                             brandonwestcott/li3\_relations - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. brandonwestcott/li3\_relations

ActiveLi3-libraries[Database &amp; ORM](/categories/database)

brandonwestcott/li3\_relations
==============================

Lithium PHP model -&gt; model relations

1.0.0(13y ago)116.4k2[1 issues](https://github.com/brandonwestcott/li3_relations/issues)GNU General Public LicensePHPPHP &gt;=5.3

Since Aug 22Pushed 13y ago2 watchersCompare

[ Source](https://github.com/brandonwestcott/li3_relations)[ Packagist](https://packagist.org/packages/brandonwestcott/li3_relations)[ Docs](https://github.com/brandonwestcott/li3_relations)[ RSS](/packages/brandonwestcott-li3-relations/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

[Lithium PHP](http://lithify.me) Plugin to allow relations on a Model basis
===========================================================================

[](#lithium-php-plugin-to-allow-relations-on-a-model-basis)

Now, don't get too extatic, this is in its early stages and only supports READ opperations &amp; hasMany or hasOne. Hope to add support for full CRUD in the future.

Simply, this is a plugin designed to add support to li3 for relations on a Model to Model basis seperate from connections. This allows not only relationship support for non supportted DBs, such as MongoDB, but also allows relationships to be cross connection/data sources. Such as Solr backed model to a Mongo backed Model. If you wish any given relation to use lithiums default relation bindings, just pass in default =&gt; false as an option in the relation (detailed below).

It is likely that this type of Model -&gt; Model support will never exist inside of lithium directly. However, with the powerful data sources lithium provides, this plugin becomes essential.

Installation
------------

[](#installation)

### Use Composer

[](#use-composer)

Modify your projects `composer.json` file

```
{
    "require": {
    	...
        "brandonwestcott/li3_relations": "master"
        ...
    }
}
```

Run `./composer.phar install` which will install this librarie into your app/libraries

### Alternately, just clone, download or submodule

[](#alternately-just-clone-download-or-submodule)

1. Clone/Download/submodule the plugin into your app's `libraries` directory.
2. Tell your app to load the plugin by adding the following to your app's `config/bootstrap/libraries.php`:

Usage
-----

[](#usage)

Add the plugin in your `config/bootstrap/libraries.php` file:

```
