PHP Classes

PHP MongoDB Mini ODM: Store and retrieve objects in MongoDB databases

Recommend this page to a friend!
  Info   View files Example   View files View files (18)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 58%Total: 366 This week: 1All time: 6,844 This week: 560Up
Version License PHP version Categories
mongodb-mini-odm 1.0GNU General Publi...5.2PHP 5, Databases, Design Patterns
Description 

Author

This package can be used to store and retrieve objects in MongoDB databases.

The main class can load model classes of objects from a given directory, so the objects can be used to store and retrieve information from a given MongoDB database records.

The model objects extend the base MongoDB table class so they define the properties, relationships and indexes of the database records that will be mapped to objects the the model classes.

The model classes can perform operations like saving an object, finding objects by a given criteria and remove objects from the database.

Innovation Award
PHP Programming Innovation award nominee
January 2015
Number 3


Prize: PhpStorm IDE personal permanent license
Nowadays many PHP applications are totally object oriented. This means that they treat practically all application entities as objects.

For applications that use relational databases, it is common to implement a layer of mapping between application objects and database records often called ORM (Object-Relational Mapping), so the application can treat information in the database as objects.

MongoDB is not really a relational database. It is rather document based database.

This package implements a concept similar to object-relational mapping but for documents stored in a MongoDB database. So it provides an interface to store and retrieve application objects from MongoDB documents.

Manuel Lemos
Picture of Maicon gonçalez
  Performance   Level  
Name: Maicon gonçalez <contact>
Classes: 5 packages by
Country: Brazil Brazil
Age: 29
All time rank: 2471171 in Brazil Brazil
Week rank: 411 Up35 in Brazil Brazil Up
Innovation award
Innovation award
Nominee: 3x

Example

<?php
   
require_once("Mongo/Mongo.php");
   
$User = new Model_Users();
   
//Use Parent
   
$User->Parent = 1; // 1: true 0:false
   
    //Defined Coluns
   
$User->Nome = "Ex Of Name";
   
$User->Email = "test@gmail.com";
   
$User->User = "James";
   
$User->Senha = sha1('123456');
   
$User->Clube = json_encode(array("Chelsea","Man. City","Barcelona"));
   
$User->Cpf = "980.098.827-20";
   
   
// News Coluns
   
$User->Macaca = "";
   
   
//Parent Model
   
$User->_Andress = array();
   
$User->_Andress['Rua'] = "Rua da Couves";
   
$User->_Andress['Bairro'] = "Pq. Esplanada";
   
$User->_Andress['Cidade'] = "Valparaiso";
   
$User->_Andress["Estado"] = "GO";
   
   
//Salvar
   
$User->save();
   
   
// Find All
   
$Find = $User->find();
    echo
"<pre>";
   
print_r($Find);
    echo
"</pre>";
   
   
/*$Find = $User->find(
        Codition,
        limit,
        skip,
        sort
    );*/
   
    // Find One
   
$Find = $User->findOneByNome("Ex Of Name");
    echo
"<pre>";
   
print_r($Find);
    echo
"</pre>";
   
   
// Find All By
   
$Find = $User->findByNome("Ex Of Name");
    echo
"<pre>";
   
print_r($Find);
    echo
"</pre>";
   
   
//Update Data (findByNome("Ex Of Name"))
   
$User->Nome = "Update Name";
   
$User->save();
   
   
/*$Find = $User->findOneBy 'NameofColun' (
        Value,
        limit,
        skip,
        sort
    );*/
   
   
?>


  Files folder image Files  
File Role Description
Files folder imageGenerator (1 file, 3 directories)
Files folder imageModels (2 files)
Files folder imageMongo (1 file, 1 directory)
Accessible without login Plain text file Teste.php Example Example

  Files folder image Files  /  Generator  
File Role Description
Files folder imagecss (3 files, 1 directory)
Files folder imagefonts (1 directory)
Files folder imagejs (1 file)
  Accessible without login Plain text file index.php Aux. Generator

  Files folder image Files  /  Generator  /  css  
File Role Description
Files folder imagesmart-themes (1 file)
  Accessible without login Plain text file font-awesome.min.css Data css for Generator
  Accessible without login Plain text file smart-addons.css Data css for Generator
  Accessible without login Plain text file smart-forms.css Data css for Generator

  Files folder image Files  /  Generator  /  css  /  smart-themes  
File Role Description
  Accessible without login Plain text file red.css Data css for Generator

  Files folder image Files  /  Generator  /  fonts  
File Role Description
Files folder imagefontawesome (1 file)

  Files folder image Files  /  Generator  /  fonts  /  fontawesome  
File Role Description
  Accessible without login Plain text file fontawesome-webfontba72.svg Data Font for Generator

  Files folder image Files  /  Generator  /  js  
File Role Description
  Accessible without login Plain text file jquery-1.9.1.min.js Output js for Generator

  Files folder image Files  /  Models  
File Role Description
  Plain text file Model_Andress.php Class Model Example
  Plain text file Model_Users.php Class Model Example

  Files folder image Files  /  Mongo  
File Role Description
Files folder imageMongo (7 files)
  Accessible without login Plain text file Mongo.php Conf. Mongo Config Connect

  Files folder image Files  /  Mongo  /  Mongo  
File Role Description
  Plain text file MongoConfig.php Class Class Mongo
  Plain text file MongoDbConnect.php Class Class Mongo
  Plain text file MongoException.php Class Class Mongo
  Plain text file MongoExceptionTable.php Class Class Mongo
  Plain text file MongoProperty.php Class Class Mongo
  Plain text file MongoTable.php Class Class Mongo
  Plain text file MongoValidation.php Class Class Mongo

 Version Control Unique User Downloads Download Rankings  
 100%
Total:366
This week:1
All time:6,844
This week:560Up
 User Ratings  
 
 All time
Utility:83%StarStarStarStarStar
Consistency:83%StarStarStarStarStar
Documentation:-
Examples:83%StarStarStarStarStar
Tests:-
Videos:-
Overall:58%StarStarStar
Rank:1501