{"action":"closed","issue":{"url":"https://api.github.com/repos/doctrine/common/issues/600","repository_url":"https://api.github.com/repos/doctrine/common","labels_url":"https://api.github.com/repos/doctrine/common/issues/600/labels{/name}","comments_url":"https://api.github.com/repos/doctrine/common/issues/600/comments","events_url":"https://api.github.com/repos/doctrine/common/issues/600/events","html_url":"https://github.com/doctrine/common/issues/600","id":120674646,"number":600,"title":"DCOM-288: Doctrine uses = operator instead of <=","user":{"login":"doctrinebot","id":2414358,"avatar_url":"https://avatars2.githubusercontent.com/u/2414358?v=4","gravatar_id":"","url":"https://api.github.com/users/doctrinebot","html_url":"https://github.com/doctrinebot","followers_url":"https://api.github.com/users/doctrinebot/followers","following_url":"https://api.github.com/users/doctrinebot/following{/other_user}","gists_url":"https://api.github.com/users/doctrinebot/gists{/gist_id}","starred_url":"https://api.github.com/users/doctrinebot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doctrinebot/subscriptions","organizations_url":"https://api.github.com/users/doctrinebot/orgs","repos_url":"https://api.github.com/users/doctrinebot/repos","events_url":"https://api.github.com/users/doctrinebot/events{/privacy}","received_events_url":"https://api.github.com/users/doctrinebot/received_events","type":"User","site_admin":false},"labels":[{"id":296194161,"url":"https://api.github.com/repos/doctrine/common/labels/Bug","name":"Bug","color":"e11d21","default":false}],"state":"closed","locked":false,"assignee":{"login":"beberlei","id":26936,"avatar_url":"https://avatars2.githubusercontent.com/u/26936?v=4","gravatar_id":"","url":"https://api.github.com/users/beberlei","html_url":"https://github.com/beberlei","followers_url":"https://api.github.com/users/beberlei/followers","following_url":"https://api.github.com/users/beberlei/following{/other_user}","gists_url":"https://api.github.com/users/beberlei/gists{/gist_id}","starred_url":"https://api.github.com/users/beberlei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beberlei/subscriptions","organizations_url":"https://api.github.com/users/beberlei/orgs","repos_url":"https://api.github.com/users/beberlei/repos","events_url":"https://api.github.com/users/beberlei/events{/privacy}","received_events_url":"https://api.github.com/users/beberlei/received_events","type":"User","site_admin":false},"assignees":[{"login":"beberlei","id":26936,"avatar_url":"https://avatars2.githubusercontent.com/u/26936?v=4","gravatar_id":"","url":"https://api.github.com/users/beberlei","html_url":"https://github.com/beberlei","followers_url":"https://api.github.com/users/beberlei/followers","following_url":"https://api.github.com/users/beberlei/following{/other_user}","gists_url":"https://api.github.com/users/beberlei/gists{/gist_id}","starred_url":"https://api.github.com/users/beberlei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beberlei/subscriptions","organizations_url":"https://api.github.com/users/beberlei/orgs","repos_url":"https://api.github.com/users/beberlei/repos","events_url":"https://api.github.com/users/beberlei/events{/privacy}","received_events_url":"https://api.github.com/users/beberlei/received_events","type":"User","site_admin":false}],"milestone":null,"comments":13,"created_at":"2015-06-29T12:03:10Z","updated_at":"2017-11-26T13:22:18Z","closed_at":"2017-11-26T13:22:18Z","author_association":"NONE","body":"Jira issue originally created by user mikemix:\n\nI'm trying to force Doctrine to use LTE operator on **activeFrom** field (datetime field), but instead EQ operator is used while matching() the many-to-many relation:\n\n```\n    /****\n     * @return SubjectInterface[]\n     */\n    public function getSubjects()\n    {\n        $expr = Criteria::expr();\n\n        return $this->subjects->matching(\n            Criteria::create()\n                ->where($expr->eq('deleted', 0))\n                ->andWhere($expr->eq('active', 1))\n                // used date() here instead of DateTime, because I get errors with it\n                ->andWhere($expr->lte('activeFrom', date('Y-m-d H:i:s'))\n            )\n        );\n    }\n```\n\ncreates following SQL query:\n\n``` sql\nSELECT te.id AS id, te.name AS name, te.active AS active, te.activeFrom AS activeFrom, te.position AS position, te.shortDescription AS shortDescription, te.description AS description, te.deleted AS deleted, te.dateCreated AS dateCreated, te.hasChat AS hasChat, te.owner*id AS owner_id FROM subject te JOIN subject_users t ON t.subject_id = te.id WHERE t.user*id = '6' AND te.deleted = '0' AND te.active = '1' AND te.activeFrom = '2015-06-29 13:50:53'\n```\n\nDoctrine schema validator says my mappings are ok.\n\n```\n// user entity\n\n    /****\n     * @var Subject[]|ArrayCollection\n     * @ORM\\ManyToMany(targetEntity=\"Subject\", inversedBy=\"users\", indexBy=\"id\")\n     * @ORM\\JoinTable(name=\"subject_users\")\n     * @ORM\\OrderBy({\"name\"=\"asc\"})\n     */\n    protected $subjects;\n\n// subject entity\n\n    /****\n     * @var \\DateTime\n     * @ORM\\Column(type=\"datetime\")\n     */\n    protected $activeFrom;\n\n    /****\n     * @var User[]|ArrayCollection\n     * @ORM\\ManyToMany(targetEntity=\"User\", mappedBy=\"subjects\", fetch=\"EXTRA_LAZY\", indexBy=\"id\")\n     * @ORM\\OrderBy({\"surname\" = \"ASC\"})\n     * @ORM\\JoinTable(name=\"subject_users\",\n     *     joinColumns={@ORM\\JoinColumn(name=\"subject_id\", referencedColumnName=\"id\")},\n     *     inverseJoinColumns={@ORM\\JoinColumn(name=\"user_id\", referencedColumnName=\"id\")}\n     * )\n     */\n    protected $users;\n```\n"}}
{"actor":{"display_login":"lcobucci"}}