syndesi / cypher-entity-manager
Provides an entity manager for Cypher data types
Installs: 5 720
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
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.4.0
Requires (Dev)
- crell/tukio: ^2.0
- friendsofphp/php-cs-fixer: ^3.48
- infection/infection: ^0.29.8
- monolog/monolog: ^3.2
- phpbench/phpbench: ^1.2
- phpspec/prophecy: ^1.18
- phpspec/prophecy-phpunit: ^2.1
- phpstan/phpstan: ^2.1
- phpunit/php-code-coverage: ^11
- phpunit/phpunit: ^11
- selective/container: ^1.2
- vimeo/psalm: ^6.2
- vlucas/phpdotenv: ^5.6
This package is auto-updated.
Last update: 2025-02-15 13:35:38 UTC
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();