{"id":13821812,"url":"https://github.com/luxifer/doctrine-functions","last_synced_at":"2025-04-06T10:14:23.999Z","repository":{"id":8635920,"uuid":"10283245","full_name":"luxifer/doctrine-functions","owner":"luxifer","description":"📚 Set of DQL Function for MySQL","archived":false,"fork":false,"pushed_at":"2017-12-21T14:06:07.000Z","size":242,"stargazers_count":89,"open_issues_count":2,"forks_count":14,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-03-15T15:51:29.300Z","etag":null,"topics":["doctrine","dql-functions","mysql","php"],"latest_commit_sha":null,"homepage":"http://luxifer.github.io/doctrine-functions/","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/luxifer.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":"2013-05-25T11:34:45.000Z","updated_at":"2023-06-05T08:00:12.000Z","dependencies_parsed_at":"2022-09-10T03:21:08.152Z","dependency_job_id":null,"html_url":"https://github.com/luxifer/doctrine-functions","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luxifer%2Fdoctrine-functions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luxifer%2Fdoctrine-functions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luxifer%2Fdoctrine-functions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luxifer%2Fdoctrine-functions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luxifer","download_url":"https://codeload.github.com/luxifer/doctrine-functions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247464226,"owners_count":20942970,"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","dql-functions","mysql","php"],"created_at":"2024-08-04T08:01:29.262Z","updated_at":"2025-04-06T10:14:23.976Z","avatar_url":"https://github.com/luxifer.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"Doctrine Functions\n==================\n\n[![Build Status](https://travis-ci.org/luxifer/doctrine-functions.svg?branch=master)](https://travis-ci.org/luxifer/doctrine-functions) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/luxifer/doctrine-functions/badges/quality-score.png?s=32406f6c6df4378a2f352bd062707d3c7a0216ea)](https://scrutinizer-ci.com/g/luxifer/doctrine-functions/) [![Code Coverage](https://scrutinizer-ci.com/g/luxifer/doctrine-functions/badges/coverage.png?s=6701d974c062e2c98ec2a556ba8ba4db76667e68)](https://scrutinizer-ci.com/g/luxifer/doctrine-functions/) [![Latest Stable Version](https://poser.pugx.org/luxifer/doctrine-functions/v/stable.png)](https://packagist.org/packages/luxifer/doctrine-functions) [![Total Downloads](https://poser.pugx.org/luxifer/doctrine-functions/downloads.png)](https://packagist.org/packages/luxifer/doctrine-functions)\n\nThis package contains doctrine functions, you can contribute by forking it and propose pull request with your own functions.\nList of available functions:\n\n* `DATE(expr)`\n* `DATEDIFF(expr1, expr2)`\n* `DAYOFWEEK(expr)`\n* `WEEK(expr)`\n* `DAY(expr)`\n* `DAYOFMONTH(expr)`\n* `DAYOFYEAR(expr)`\n* `HOUR(expr)`\n* `MINUTE(expr)`\n* `MONTH(expr)`\n* `QUARTER(expr)`\n* `SECOND(expr)`\n* `TIME(expr)`\n* `YEAR(expr)`\n* `CONVERT_TZ(expr, 'from_tz', 'to_tz')` (MySQL)\n* `DATE_FORMAT(expr, 'format')` (MySQL)\n* `CONCAT_WS(separator, str1, str2, ...)` (MySQL)\n* `RAND()` (MySQL)\n* `MD5(expr)` (MySQL, Postgres)\n* `FROM_UNIXTIME(expr1, expr2)` (MySQL)\n\nEdit this file in your pull request to add your functions to the list.\n\nRequirements\n------------\n\nThis library is expected to work with PHP \u003e= 5.3, but you should consider to upgrade to PHP \u003e= 7.0. To contribute to this library you must have PHP \u003e= 7.0 to run the test suite.\n\nInstallation\n------------\n\nJust add the package to your `composer.json`\n\n```json\n{\n    \"require\": {\n        \"luxifer/doctrine-functions\": \"^1.5\"\n    }\n}\n```\n\nIntegration\n-----------\n\n### 1) Doctrine Only\n\nAccording to the [Doctrine documentation](http://doctrine-orm.readthedocs.org/en/latest/cookbook/dql-user-defined-functions.html \"Doctrine documentation\") you can register the functions in this package this way.\n\n```php\n\u003c?php\n$config = new \\Doctrine\\ORM\\Configuration();\n$config-\u003eaddCustomDatetimeFunction('date', 'Luxifer\\DQL\\Datetime\\Date');\n\n$em = EntityManager::create($dbParams, $config);\n```\n\n### 2) Using Symfony 2\n\nWith Symfony 2 you can register your functions directly in the `config.yml` file.\n\n```yaml\ndoctrine:\n    orm:\n        entity_managers:\n            default:\n                dql:\n                    datetime_functions:\n                        date:     Luxifer\\DQL\\Datetime\\Date\n                        datediff: Luxifer\\DQL\\Datetime\\DateDiff\n                        # etc\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluxifer%2Fdoctrine-functions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluxifer%2Fdoctrine-functions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluxifer%2Fdoctrine-functions/lists"}