syndesi / cypher-entity-manager
Provides an entity manager for Cypher data types
Installs: 5 060
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 1
Open Issues: 0
Requires
- php: ^8.1
- laudis/neo4j-php-client: ^3.0
- psr/event-dispatcher: ^1.0
- psr/log: ^3.0
- syndesi/cypher-data-structures: ^0.3.0
Requires (Dev)
- boesing/psalm-plugin-stringf: ^1.1
- crell/tukio: ^1.4
- friendsofphp/php-cs-fixer: ^3.8
- infection/infection: ^0.27.8
- monolog/monolog: ^3.2
- phpbench/phpbench: ^1.2
- phpspec/prophecy: ^1.15
- phpstan/phpstan: ^1.6
- phpunit/php-code-coverage: ^9.2
- phpunit/phpunit: ^9.5
- roave/no-leaks: ^1.3
- selective/container: ^1.2
- vimeo/psalm: ^5.16
- vlucas/phpdotenv: ^5.5
README
Syndesi's Cypher Entity Manager
This library provides an entity manager for Cypher data types.
This basically means, that you do not have to write create/merge/delete statements for your nodes, relations etc. per
hand. Instead, you just call $em->create($node)
, $em->merge($node)
, $em->delete($node)
and at the end
$em->flush()
.
Installation
To install this library, run the following code:
composer require syndesi/cypher-entity-manager
This is all, now you can use the library :D
Using the library
use Syndesi\CypherDataStructures\Type\Node; use Syndesi\CypherEntityManager\Type\EntityManager; /** * note: the container should be provided by your framework. manual configuration is possible, see documentation * @var EntityManagerInterface $em */ $em = $container->get(EntityManager::class); $node = new Node(); $node ->addLabel('NodeLabel') ->addIdentifier('id', 123) ->addProperty('someProperty', 'someValue') ->addIdentifier('id'); // create a node: $em->create($node); $em->flush(); // update a node: $node->addProperty('newProperty', 'Hello world :D'); $em->merge($node); $em->flush(); // delete a node: $em->delete($node); $em->flush();