{"id":24085079,"url":"https://github.com/mapado/mysqldoctrinefunctions","last_synced_at":"2025-04-30T21:51:32.185Z","repository":{"id":6628504,"uuid":"7872367","full_name":"mapado/MysqlDoctrineFunctions","owner":"mapado","description":"MySQL Function for Doctrine : RAND(), ROUND() DATE(), DATE_FORMAT()","archived":false,"fork":false,"pushed_at":"2023-09-15T07:06:32.000Z","size":97,"stargazers_count":44,"open_issues_count":1,"forks_count":5,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-04-30T21:51:27.442Z","etag":null,"topics":["doctrine","mysql","mysql-functions","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mapado.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-01-28T15:25:19.000Z","updated_at":"2023-10-10T12:48:39.000Z","dependencies_parsed_at":"2024-06-18T21:15:03.778Z","dependency_job_id":"07d0634b-fcb9-46cd-94ff-40092a10c8d5","html_url":"https://github.com/mapado/MysqlDoctrineFunctions","commit_stats":{"total_commits":21,"total_committers":8,"mean_commits":2.625,"dds":0.5238095238095238,"last_synced_commit":"9b9ed0994b41b947a89ec90bc02207ae6aaac5e1"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapado%2FMysqlDoctrineFunctions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapado%2FMysqlDoctrineFunctions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapado%2FMysqlDoctrineFunctions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapado%2FMysqlDoctrineFunctions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mapado","download_url":"https://codeload.github.com/mapado/MysqlDoctrineFunctions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251789307,"owners_count":21644081,"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":["doctrine","mysql","mysql-functions","php"],"created_at":"2025-01-10T01:01:24.614Z","updated_at":"2025-04-30T21:51:32.178Z","avatar_url":"https://github.com/mapado.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"MySQL Doctrine functions\n====================\n\nThis library provides you MySQL functions for Doctrine2.\n\nAt the moment are supported\n\n - RAND\n - ROUND\n - DATE\n - DATE_FORMAT\n\nFeel free to fork and add other functions.\n\n## Installation\n\n### Get the package\n\nWith [composer](https://getcomposer.org/)\n\n```sh\ncomposer require mapado/mysql-doctrine-functions\n```\n\n### Add the classes to your configuration\n\n```php\n$config = new \\Doctrine\\ORM\\Configuration();\n$config-\u003eaddCustomStringFunction('rand', \\Mapado\\MysqlDoctrineFunctions\\DQL\\MysqlRand::class);\n$config-\u003eaddCustomStringFunction('round', \\Mapado\\MysqlDoctrineFunctions\\DQL\\MysqlRound::class);\n$config-\u003eaddCustomStringFunction('date', \\Mapado\\MysqlDoctrineFunctions\\DQL\\MysqlDate::class);\n$config-\u003eaddCustomStringFunction('date_format', \\Mapado\\MysqlDoctrineFunctions\\DQL\\MysqlDateFormat::class);\n\n$em = EntityManager::create($dbParams, $config);\n```\nYou can of course pick just the functions you need.\n\n### Use with Symfony\nIf you install the library in a Symfony application, you can add this in your `config.yml` file (`doctrine.yaml` file if you use symfony flex)\n\n```yaml\n# app/config/config.yml\ndoctrine:\n    orm:\n        # ...\n        entity_managers:\n            default:\n                # ...\n                dql:\n                    numeric_functions:\n                        rand:        'Mapado\\MysqlDoctrineFunctions\\DQL\\MysqlRand'\n                        round:       'Mapado\\MysqlDoctrineFunctions\\DQL\\MysqlRound'\n                    datetime_functions:\n                        date:        'Mapado\\MysqlDoctrineFunctions\\DQL\\MysqlDate'\n                        date_format: 'Mapado\\MysqlDoctrineFunctions\\DQL\\MysqlDateFormat'\n                    # ... add all functions you need\n```\n\n### Usage\nYou can now use the functions in your DQL Query\n\n```php\n$query = 'SELECT RAND(), ROUND(123.45) \n        FROM ...\n    ';\n$em-\u003ecreateQuery($query);\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapado%2Fmysqldoctrinefunctions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmapado%2Fmysqldoctrinefunctions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapado%2Fmysqldoctrinefunctions/lists"}