{"id":23219126,"url":"https://github.com/b2pweb/bdf-prime","last_synced_at":"2025-08-19T08:32:45.384Z","repository":{"id":37080291,"uuid":"265896180","full_name":"b2pweb/bdf-prime","owner":"b2pweb","description":"Prime ORM for php","archived":false,"fork":false,"pushed_at":"2025-05-09T14:36:53.000Z","size":1905,"stargazers_count":3,"open_issues_count":12,"forks_count":0,"subscribers_count":2,"default_branch":"2.3","last_synced_at":"2025-07-04T19:53:02.645Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/b2pweb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-05-21T16:20:24.000Z","updated_at":"2025-05-02T10:17:34.000Z","dependencies_parsed_at":"2024-01-12T01:29:14.386Z","dependency_job_id":"aea5d470-1019-48ca-942f-8bf755091198","html_url":"https://github.com/b2pweb/bdf-prime","commit_stats":{"total_commits":132,"total_committers":5,"mean_commits":26.4,"dds":0.3257575757575758,"last_synced_commit":"feef51c8895d2c90b3e05d28305b035e4dc23aa9"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/b2pweb/bdf-prime","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b2pweb%2Fbdf-prime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b2pweb%2Fbdf-prime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b2pweb%2Fbdf-prime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b2pweb%2Fbdf-prime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/b2pweb","download_url":"https://codeload.github.com/b2pweb/bdf-prime/tar.gz/refs/heads/2.3","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b2pweb%2Fbdf-prime/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270837465,"owners_count":24654387,"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","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-12-18T21:19:21.966Z","updated_at":"2025-08-19T08:32:44.787Z","avatar_url":"https://github.com/b2pweb.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Prime\n\nPrime is a Data mapper ORM based on doctrine DBAL. \nThe goal of prime is to lightweight usage of data mapper and doctrine DBAL.\n\n[![build](https://github.com/b2pweb/bdf-prime/actions/workflows/php.yml/badge.svg)](https://github.com/b2pweb/bdf-prime/actions/workflows/php.yml)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/b2pweb/bdf-prime/badges/quality-score.png?b=2.0)](https://scrutinizer-ci.com/g/b2pweb/bdf-prime/?branch=2.0)\n[![codecov](https://codecov.io/github/b2pweb/bdf-prime/branch/2.1/graph/badge.svg?token=VOFSPEWYKX)](https://codecov.io/github/b2pweb/bdf-prime)\n[![Packagist Version](https://img.shields.io/packagist/v/b2pweb/bdf-prime.svg)](https://packagist.org/packages/b2pweb/bdf-prime)\n[![Total Downloads](https://img.shields.io/packagist/dt/b2pweb/bdf-prime.svg)](https://packagist.org/packages/b2pweb/bdf-prime)\n[![Type Coverage](https://shepherd.dev/github/b2pweb/bdf-prime/coverage.svg)](https://shepherd.dev/github/b2pweb/bdf-prime)\n\n\n### Getting Started\n\nSee [Wiki](https://github.com/b2pweb/bdf-prime/wiki) for more information\n\n```bash\ncomposer require b2pweb/bdf-prime\n```\n\n```PHP\n\u003c?php\n\nuse Bdf\\Prime\\ConnectionManager;\nuse Bdf\\Prime\\Entity\\Model;\nuse Bdf\\Prime\\Mapper\\Mapper;\nuse Bdf\\Prime\\Mapper\\Builder\\FieldBuilder;\nuse Bdf\\Prime\\Mapper\\Builder\\IndexBuilder;\nuse Bdf\\Prime\\Query\\Expression\\Like;\nuse Bdf\\Prime\\ServiceLocator;\n\n// Declare your entity\nclass User extends Model\n{\n    public $id;\n    public $firstName;\n    public $lastName;\n    public $email;\n\n    public function __construct(array $data) \n    {\n        $this-\u003eimport($data);\n    }\n}\n\n// Declare the data mapper for the entity\nclass UserMapper extends Mapper\n{\n    public function schema(): array\n    {\n        return [\n            'connection' =\u003e 'myDB',\n            'table'      =\u003e 'users',\n        ];\n    }\n    \n    public function buildFields(FieldBuilder $builder): void\n    {\n        $builder\n            -\u003ebigint('id')-\u003eautoincrement()\n            -\u003estring('firstName')\n            -\u003estring('lastName')\n            -\u003estring('email')\n        ;\n    }\n\n    public function buildIndexes(IndexBuilder $builder): void\n    {\n        $builder-\u003eadd()-\u003eon('name');\n    }\n}\n\n// Declare your connections\n$connexions = new ConnectionManager();\n$connexions-\u003edeclareConnection('myDB', 'mysql://myuser:mypassword@localhost');\n\n// Use the service locator to locate your repositories\n$manager = new ServiceLocator($connexions);\nLocatorizable::configure($manager);\n$repository = $manager-\u003erepository(User::class);\n\n// Get and update an entity\n$user = User::findById(1);\n$user-\u003esetFirstName('john')-\u003esave();\n\n// Use a query builder for searching entities \nUser::where('firstName', 'john')-\u003eorWhere('email', (new Like('john%'))-\u003estartsWith())-\u003eall();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb2pweb%2Fbdf-prime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fb2pweb%2Fbdf-prime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb2pweb%2Fbdf-prime/lists"}