davidbadura / orangedb
This package is abandoned and no longer maintained.
No replacement package was suggested.
Readonly Filesystem Database | Object-File Mapping
1.0-alpha11
2019-11-15 18:53 UTC
Requires
- php: >=7.2
- doctrine/annotations: ^1.2
- jms/metadata: ^1.5
- symfony/finder: ^3.0|^4.0|^5.0
- symfony/yaml: ^3.0|^4.0|^5.0
- timetoogo/pinq: ^3.3
- webmozart/json: ^1.2
- webmozart/path-util: ^2.3
Requires (Dev)
- phpunit/phpunit: ^7.1
- symfony/filesystem: ^4.0|^5.0
- symfony/var-dumper: ^3.0|^4.0|^5.0
- dev-master
- 1.0-alpha11
- 1.0-alpha10
- 1.0-alpha9
- 1.0-alpha8
- 1.0-alpha7
- 1.0-alpha6
- 1.0-alpha5
- 1.0-alpha4
- 1.0-alpha3
- 1.0-alpha2
- 1.0-alpha1
- dev-renovate/major-phpstan-packages
- dev-renovate/pin-dependencies
- dev-renovate/phpstan-packages
- dev-renovate/psalm-phar-4.x
- dev-renovate/major-symfony
- dev-renovate/jms-metadata-2.x
- dev-renovate/actions-checkout-3.x
- dev-renovate/actions-cache-3.x
- dev-next
- dev-upgrade-php74
This package is auto-updated.
Last update: 2022-07-23 21:09:37 UTC
README
OrangeDB is a library about high performance transition of master data from yaml/json to objects.
Installation
You can easily install this package over composer
composer require 'davidbadura/orangedb'
Example
Model
<?php use DavidBadura\OrangeDb\Annotation as OD; /** * @OD\Document("character") */ class Character { /** * @OD\Type("string") */ private $name; /** * @OD\Type("integer") */ private $age; /** * @OD\ReferenceMany("Character") */ private $children; public function getName(): string { return $this->name; } public function getAge(): int { return $this->age; } public function getChildren(): array { return $this->children; } }
Data
# /var/cache/orangedb/character/sarah.yaml name: Sarah Connor age: 32 children: ['john'] # /var/cache/orangedb/character/john.yaml name: John Connor age: 8 children: []
Usage
<?php use DavidBadura\OrangeDb\DocumentManager; use DavidBadura\OrangeDb\Adapter\YamlAdapter; $manager = new DocumentManager(new YamlAdapter(__DIR__.'/data'), __DIR__.'/var/cache/orangedb'); $character = $manager->find(Character::class, 'sarah'); echo $character->getName(); // Sarah Connor echo $character->getAge(); // 32 echo count($character->getChildren()); // 1 echo $character->getChildren()[0]->getName(); //John Connor