{"id":13545675,"url":"https://github.com/doctrine/orientdb-odm","last_synced_at":"2025-04-02T15:31:34.717Z","repository":{"id":56970659,"uuid":"1362753","full_name":"doctrine/orientdb-odm","owner":"doctrine","description":"A set of PHP libraries in order to use OrientDB from PHP","archived":true,"fork":false,"pushed_at":"2021-10-27T21:58:44.000Z","size":2013,"stargazers_count":156,"open_issues_count":46,"forks_count":54,"subscribers_count":30,"default_branch":"master","last_synced_at":"2024-05-21T20:33:22.994Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://odino.org/blog/categories/orientdb/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/doctrine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-02-13T20:12:32.000Z","updated_at":"2024-02-05T09:41:06.000Z","dependencies_parsed_at":"2022-08-21T07:10:19.145Z","dependency_job_id":null,"html_url":"https://github.com/doctrine/orientdb-odm","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doctrine%2Forientdb-odm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doctrine%2Forientdb-odm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doctrine%2Forientdb-odm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doctrine%2Forientdb-odm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doctrine","download_url":"https://codeload.github.com/doctrine/orientdb-odm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244440584,"owners_count":20453028,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T11:01:09.169Z","updated_at":"2025-04-02T15:31:34.686Z","avatar_url":"https://github.com/doctrine.png","language":"PHP","readme":"# OrientDB PHP Library\n\n[![Build Status](https://secure.travis-ci.org/doctrine/orientdb-odm.png?branch=master)](http://secure.travis-ci.org/doctrine/orientdb-odm)\n[![Total Downloads](https://poser.pugx.org/doctrine/orientdb-odm/downloads.png)](https://packagist.org/packages/doctrine/orientdb-odm)\n[![Latest Stable Version](https://poser.pugx.org/doctrine/orientdb-odm/v/stable.png)](https://packagist.org/packages/doctrine/orientdb-odm)\n## What's Orient?\n\nA set of tools to use and manage any OrientDB instance from PHP.\n\nOrient includes:\n\n* the HTTP protocol binding\n* the query builder\n* the data mapper ( Object Graph Mapper )\n\nIf you don't know [OrientDB](http://www.orientechnologies.com/) take a look at its [Documentation](http://code.google.com/p/orient).\n\n\n## After cloning\n\nIn order to be able to run the examples and the test suite provided by Orient, you must first enter the root of\nthe cloned repository and initialize all the needed dependencies using [Composer](http://getcomposer.org/).\nWe provide an utility script in the `bin/` subdirectory to ease this process so you can just do the following:\n\n```\n$ ./bin/initialize-dependencies.sh\n```\n\n\n## Current status of the binding\n\nThe binding is complete: it is an HTTP client wrapper with some methods bound to OrientDB's HTTP interface.\n\nIts usage is straightforward:\n\n```\n$parameters = Doctrine\\OrientDB\\Binding\\BindingParameters::create('http://admin:admin@127.0.0.1:2480/demo');\n$orient = new Doctrine\\OrientDB\\Binding\\HttpBinding($parameters);\n$output = $orient-\u003equery(\"SELECT FROM Address\");\n\nforeach ($output-\u003egetResult() as $address) {\n    var_dump($address-\u003estreet);\n}\n```\n\nUse the PHP5.3 standard autoloader (https://gist.github.com/221634).\n\n\n## Current status of the query builder\n\nThe query-builder is finished, in the future we will consider the integration of OrientDB\nGraph Edition: http://code.google.com/p/orient/wiki/GraphEdTutorial.\n\nTo take advantage of the QB you only have to instantiate a Query object:\n\n```\nuse Doctrine\\OrientDB\\Query\\Query;\n\n$query = new Query();\n$query-\u003efrom(array('users'))-\u003ewhere('username = ?', \"admin\");\n\necho $query-\u003egetRaw();      // SELECT FROM users WHERE username = \"admin\"\n```\n\nThe Query object incapsulates lots of sub-commands, like SELECT, DROP, GRANT, INSERT\nand so on...\n\nYou can use also those commands:\n\n```\nuse Doctrine\\OrientDB\\Query\\Command\\Select;\n\n$select = new Select(array('users'));\necho $select-\u003egetRaw();     // SELECT FROM users\n```\n\nHowever, we strongly discourage this approach: commands will change, Query, thought as a facade, - hopefully - not.\n\nYou'd better take a look at the tests of the Query class and its subcommands to get\na full overview of the available commands: in order to match OrientDB's native\nSQL-like synthax we tried to preserve names and stuff like that, but a few things\nhave changed so far.\n\n\n## Current status of the mapper\n\nWe started working on the mapper and, right now, it is able to map OrientDB responses (converted in StdObject) to annotation-mapped POPOs.\nAlso collections are hydrated properly.\n\nHowever, it's under heavy work, so don't expect to be able to use it in a few weeks. Next steps are:\n\n* hydrate OrientDB native data-type (it includes floats, embedded-set|link|list, embedded-map|link|list and many others...)\n* provide a base repository class\n* implementation of the persistence from the ODM to OrientDB\n\n\n## Utilities\n\nOrient incapsulates also a few utilities for PHP developers: on of them is an implementation of Dijkstra's algorithm.\n\n```\nuse Doctrine\\OrientDB\\Graph\\Graph;\nuse Doctrine\\OrientDB\\Graph\\Vertex;\nuse Doctrine\\OrientDB\\Graph\\Algorithm\\Dijkstra;\n\n$graph = new Graph();\n\n$rome = new Vertex('Rome');\n$paris = new Vertex('Paris');\n$london = new Vertex('London');\n\n$rome-\u003econnect($paris, 2);\n$rome-\u003econnect($london, 3);\n$paris-\u003econnect($london, 1);\n\n$graph-\u003eadd($rome);\n$graph-\u003eadd($paris);\n$graph-\u003eadd($london);\n\n$algorithm = new Dijkstra($graph);\n$algorithm-\u003esetStartingVertex($rome);\n$algorithm-\u003esetEndingVertex($london);\n\nvar_dump($algorithm-\u003esolve());\n```\n\n\n## Tests\n\nThe test suite can be launched simply by executing `phpunit` from the root directory of the repository.\n\nBy default the suite does not perform integration tests to verify the correct behaviour of our implementation against a running instance of OrientDB.\nSince integration tests are marked using the [@group](http://www.phpunit.de/manual/current/en/appendixes.annotations.html#appendixes.annotations.group)\nannotation, they can be enabled by default via `phpunit.xml` by adding a comment to the `integration` group in the list of excluded groups or,\nif you just want to execute them on a single execution basis, first load fixtures with this script\n\n```\nphp ./test/Integration/fixtures/load.php\n```\n\nfolloweb by launching the suite with the additional `--group` argument:\n\n```\nphpunit --group __nogroup__,integration\n```\n\nIt is also possible to generate a HTML report showing the code health of the library using `PHP_CodeBrowser` paired with the following dependencies\n(in addition to `phpunit`):\n\n* phpcpd\n* phpdcd\n* phploc\n* phpmd\n* phpdepend\n* phpcb\n\nExecuting `./bin/report.sh` from the root directory of the repository will generate the report in `log/report/index.html`.\n\n\n## Requirements\n\nThese are the requirements in order to use the library:\n\n* PHP \u003e= 5.3.3\n* OrientDB \u003e= 1.2.0\n\nIn order to launch the test suite PHPUnit 3.6 is required.\n\n\n## Tracker \u0026 software lifecycle\n\nSee: https://github.com/doctrine/orientdb-odm/issues\n\n\n## Further documentation\n\nIf you want to take a look at a fancy PHPDoc documentation you can use doxygen:\n\n```\nsudo apt-get install doxygen\n```\n\nand then use the script provided under the docs directory:\n\n```\ndoxygen docs/orient.d\n```\n\nwhich will generate technical documentation under the folder docs/html.\n","funding_links":[],"categories":["PHP"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoctrine%2Forientdb-odm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoctrine%2Forientdb-odm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoctrine%2Forientdb-odm/lists"}