2017 © Pedro Peláez
 

library structural

Fluent NoSQL Toolkit

image

respect/structural

Fluent NoSQL Toolkit

  • Saturday, May 5, 2012
  • by henriquemoody
  • Repository
  • 9 Watchers
  • 13 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Respect/Structural

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

Build Status Scrutinizer Code Quality Code Coverage StyleCI, (*2)

The Near-zero Part

// bootstrap.php
require_once __DIR__ . '/vendor/autoload.php';

use Respect\Structural\Mapper;
use Respect\Structural\Driver\MongoDb\Style as MongoDbStyle;
use Respect\Structural\Driver\MongoDb\Driver as MongoDbDriver;

$driver = MongoDbDriver::factory('respect');

$mapper = new Mapper($driver);
$mapper->setStyle(new MongoDbStyle());

Persisting

$author = new \stdClass();
$author->firstName = 'Antonio';
$mapper->authors->persist($author);
$mapper->flush();

echo "'{$author->firstName}' was created with id({$author->_id})".PHP_EOL;

Updating

$author->lastName = 'Spinelli';
$mapper->authors->persist($author);
$mapper->flush();

echo "last name was updated to '{$author->lastName}' from id({$author->_id})".PHP_EOL;

Fetching

$authors = $mapper->authors->fetchAll();

echo "Fetching all authors:" . PHP_EOL;
foreach ($authors as $index => $author) {
    echo "{$index} {$author->firstName} {$author->lastName}" . PHP_EOL;
}

Condition

// find author by ID
$foundAuthor = $mapper->authors[(string)$author->_id]->fetch();
echo "find by id('{$author->_id}') {$foundAuthor->firstName} {$foundAuthor->lastName}".PHP_EOL;

Removing

$mapper->authors->remove($author);
$mapper->flush();

$author = $mapper->authors(['lastName' => 'Spinelli'])->fetch();
echo ($author ? "'Spinelli' was found" : "'Spinelli' removed.");

The Versions

05/05 2012

dev-master

9999999-dev http://respect.li

Fluent NoSQL Toolkit

  Sources   Download

BSD Style

The Requires

 

The Development Requires

by Claudson Oliveira
by Fabio da Silva Ribeiro
by Rogerio Prado de Jesus
by Thiago Rigo
by Alexandre Gomes Gaigalas
by Fábio da Silva Ribeiro

mongodb aws nosql mongo odm data dynamodb respect dynamo aws dynamo aws dynamodb