Download the PHP package wcatron/mongo-db-framework without Composer

On this page you can find all versions of the php package wcatron/mongo-db-framework. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mongo-db-framework

MongoDB Framework PHP

A MongoDB interface and ODM (assistant) all in one. Extremely flexible for any project.

Build Status

Overview

This framework allows you to quickly map objects to documents in a MongoDB collection.

Setup

Create models for documents and have them extend Document. Implement the toDocument and fromDocument methods and set the COLLECTION constant. Call MDB::configure() in your autoload.php file or wherever needed before database calls. You can now perform queries and get php objects back.

Installation

Composer

Models & MDB

Models

Your classes. Add two functions and a variable and allow any model to create objects.

Saving is extremely simple when you have an object whose class extends document.

$object->save();

MDB

Your connection to mongo. To get your documents as objects use this singleton MDB::getInstance()

getObjectByID(Class::class,$id)

Alternatively you can just call getByID($id) on your custom Document object.

This will return your exact object.

getObjectsFromQuery(Class::class,$query)

An array of objects based on a custom query. Not all queries need to be written out though.

getObjectsByKey('ClassName', 'KeyName', $value)

If you're only searching by one key-value pair. This simple function will work.

Documents & Objects

By using the toDocument and fromDocument methods classes can customize how their data is stored verses how it is presented to the PHP application. This allows for far greater flexibility than many other ODMs. It does however limit the ability to link object properties directly with document keys. This is the reasoning behind the KeysChanged model. It is understood this may be slower on the application side because of the extra calculations however we believe it is easier to develop if you don't have to worry about how property changes effect the underlying document structure.

Normalizing Arrays and Objects

There are two normalizing methods that can take an object ID or an array of IDs and turn them into the objects they represent only when they are asked for.

Examples:

IDs as Strings

All IDs are treated as strings and converted to MongoIDs by the MongoDB class. No converting between MongoIDs and strings. If someone sees a major issue here please speak up.


All versions of mongo-db-framework with dependencies

PHP Build Version
Package Version
Requires wcatron/common-db-framework Version 0.1.2
mongodb/mongodb Version >=1.0.0
php Version >=5.5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package wcatron/mongo-db-framework contains the following files

Loading the files please wait ....