{"id":18367847,"url":"https://github.com/photon/storage-mongodb-object","last_synced_at":"2025-04-10T16:58:28.327Z","repository":{"id":57039275,"uuid":"47611342","full_name":"photon/storage-mongodb-object","owner":"photon","description":"Micro ORM for MongoDB","archived":false,"fork":false,"pushed_at":"2020-09-17T08:27:28.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-20T23:34:34.482Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/photon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-08T09:15:15.000Z","updated_at":"2020-09-17T08:22:08.000Z","dependencies_parsed_at":"2022-08-23T23:30:54.117Z","dependency_job_id":null,"html_url":"https://github.com/photon/storage-mongodb-object","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/photon%2Fstorage-mongodb-object","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/photon%2Fstorage-mongodb-object/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/photon%2Fstorage-mongodb-object/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/photon%2Fstorage-mongodb-object/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/photon","download_url":"https://codeload.github.com/photon/storage-mongodb-object/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248259453,"owners_count":21074127,"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-11-05T23:23:42.866Z","updated_at":"2025-04-10T16:58:28.299Z","avatar_url":"https://github.com/photon.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"storage-mongodb-object\n====================\n\n[![Build Status](https://travis-ci.org/photon/storage-mongodb-object.svg?branch=master)](https://travis-ci.org/photon/storage-mongodb-object)\n\nMicro ORM for MongoDB\n\nPHP Versions\n------------\n\n- 5.6, 7.0 and 7.1 are supported and tested under travis\n- Use ext-mongodb and mongodb/mongodb. Do not works anymore with legacy ext-mongo\n\n\nQuick start\n-----------\n\n1) Add the module in your project\n\nYou need to have composer available in your system\n\n    composer require \"photon/storage-mongodb-object:dev-master\"\n\nor for a specific version\n\n    composer require \"photon/storage-mongodb-object:^3.0\"\n\n2) Define a database\n\nDefine a MongoDB connection in your project configuration\n\n    'databases' =\u003e array(\n        'default' =\u003e array(\n            'engine' =\u003e '\\photon\\db\\MongoDB',\n            'server' =\u003e 'mongodb://localhost:27017/',\n            'database' =\u003e 'orm',\n            'options' =\u003e array(\n                'connect' =\u003e true,\n            ),\n        ),\n    ),\n\n3) Create custom object\n\nFor exemple a class to store user informations\n\n    class User extends \\photon\\storage\\mongodb\\Object\n    {\n        const collectionName = 'users';\n\n        public function initObject()\n        {\n            $this-\u003ectm = new DateTime;\n            $this-\u003eactivated = false;\n        }\n    }\n\n4) Use it\n\nUse you object in your PHP code\n\n    $user = new User;\n    $user-\u003ename = 'Foo';\n    $user-\u003esave();\n\n5) Enjoy !\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphoton%2Fstorage-mongodb-object","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphoton%2Fstorage-mongodb-object","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphoton%2Fstorage-mongodb-object/lists"}