{"id":16590404,"url":"https://github.com/kocal/zend-expressive-database","last_synced_at":"2026-04-19T12:36:45.310Z","repository":{"id":57007900,"uuid":"99447349","full_name":"Kocal/zend-expressive-database","owner":"Kocal","description":"Zend-Expressive subcomponent for database ORM","archived":false,"fork":false,"pushed_at":"2017-08-05T21:10:15.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-18T12:06:01.646Z","etag":null,"topics":["database","zend-expressive","zend-expressive-database"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kocal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-05T20:55:36.000Z","updated_at":"2017-08-05T21:49:26.000Z","dependencies_parsed_at":"2022-08-21T14:31:27.266Z","dependency_job_id":null,"html_url":"https://github.com/Kocal/zend-expressive-database","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kocal%2Fzend-expressive-database","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kocal%2Fzend-expressive-database/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kocal%2Fzend-expressive-database/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kocal%2Fzend-expressive-database/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kocal","download_url":"https://codeload.github.com/Kocal/zend-expressive-database/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242213358,"owners_count":20090693,"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":["database","zend-expressive","zend-expressive-database"],"created_at":"2024-10-11T23:12:50.680Z","updated_at":"2026-04-19T12:36:45.259Z","avatar_url":"https://github.com/Kocal.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Zend-Expressive Database\n========================\n\n\u003e A Zend-Expressive subcomponent for easily unifying database ORM usage.\n\n## Current implementations\n\n- [Doctrine](https://github.com/Kocal/zend-expressive-doctrinedatabase)\n\n## Usage\n\n### `DatabaseFactoryInterface`\n\nThis interface should be implemented by a class that will be invoked by Zend Expressive to initialize the ORM.\n\nExample for Doctrine:\n```php\n\u003c?php\n\nuse Doctrine\\ORM\\EntityManager;\nuse Kocal\\Expressive\\Database\\DatabaseFactoryInterface;\nuse Psr\\Container\\ContainerInterface;\n\nclass EntityManagerFactory implements DatabaseFactoryInterface {\n    public function __invoke(ContainerInterface $container) {\n        $config = $container-\u003eget('config');\n        // ...\n        return EntityManager::create($foo, $bar);\n    }\n}\n```\n\n### `DatabaseRepositoryInterface`\n\nThis interface should be implemented by a repository.\n\nExample:\n\n```php\n\u003c?php\n\nuse \\Kocal\\Expressive\\Database\\DatabaseRepository;\n\nclass PostRepository implements DatabaseRepository {\n    /**\n     * Finds all Entities in the repository.\n     * @return mixed\n     */\n    public function all() {\n        \n    }\n\n    /**\n     * Finds the first Entity in the repository.\n     * @return mixed\n     */\n    public function first() {\n        \n    }\n\n    /**\n     * Finds the last Entity in the repository.\n     * @return mixed\n     */\n    public function last() {\n    \n    }\n\n    /**\n     * Finds an Entity by its ID.\n     * @param mixed $id\n     * @return mixed\n     */\n    public function find($id) {\n        \n    }\n\n    /**\n     * Finds all Entities where `$field` value is equal `$value`.\n     * @param string $field\n     * @param mixed $value\n     * @param array|null $orderBy\n     * @return mixed\n     */\n    public function findByField($field, $value, $orderBy = null) {\n    \n    }\n\n    /**\n     * Finds all Entities depending on `$criteria`.\n     * @param array $criteria\n     * @param array|null $orderBy\n     * @param int|null $limit\n     * @param int|null $offset\n     * @return mixed\n     */\n    public function findWhere(array $criteria, $orderBy = null, $limit = null, $offset = null) {   \n        \n    }\n\n    /**\n     * Finds Entities where `$column` is in `$where` array.\n     * @param string $column\n     * @param array $where\n     * @return mixed\n     */\n    public function findWhereIn($column, array $where) {\n    \n    }\n\n    /**\n     * Finds Entities where `$column` is not in `$where` array.\n     * @param string $column\n     * @param array $where\n     * @return mixed\n     */\n    public function findWhereNotIn($column, array $where) {\n        \n    }\n\n    /**\n     * Save an Entity.\n     * @param object $entity\n     * @return void\n     */\n    public function save($entity) {\n    \n    }\n\n    /**\n     * Delete an Entity by its ID or by itself.\n     * @param int|object $idOrEntity\n     * @return void\n     */\n    public function delete($idOrEntity) {\n           \n    }    \n}\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkocal%2Fzend-expressive-database","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkocal%2Fzend-expressive-database","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkocal%2Fzend-expressive-database/lists"}