DDC-3157: [GH-1052] [DDC-3087] Add readonly attribute to Field ORM Mapping to avoid generating a setter #3913

Closed
opened 2026-01-22 14:31:21 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Jun 7, 2014).

Originally assigned to: @Ocramius on GitHub.

Jira issue originally created by user @doctrinebot:

This issue is created automatically through a Github pull request on behalf of cstea:

Url: https://github.com/doctrine/doctrine2/pull/1052

Message:

The change allows one to enter a field attribute called "readonly". What this does is when using doctrine:generate:entities, only a getter is generated, setter is omitted.

Example use on a created field that uses Timestampable and should not have a setter:
/****
* @var /DateTime $createdAt
*
* @Gedmo\Timestampable(on="create")
* @ORM\Column(type="datetime", readonly=true)
*/
private $createdAt;

Originally created by @doctrinebot on GitHub (Jun 7, 2014). Originally assigned to: @Ocramius on GitHub. Jira issue originally created by user @doctrinebot: This issue is created automatically through a Github pull request on behalf of cstea: Url: https://github.com/doctrine/doctrine2/pull/1052 Message: The change allows one to enter a field attribute called "readonly". What this does is when using doctrine:generate:entities, only a getter is generated, setter is omitted. Example use on a created field that uses Timestampable and should not have a setter: /**** \* @var /DateTime $createdAt * \* @Gedmo\Timestampable(on="create") \* @ORM\Column(type="datetime", readonly=true) */ private $createdAt;
admin added the New Feature label 2026-01-22 14:31:21 +01:00
admin closed this issue 2026-01-22 14:31:21 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jun 7, 2014):

Comment created by @doctrinebot:

A related Github Pull-Request [GH-1052] was closed:
https://github.com/doctrine/doctrine2/pull/1052

@doctrinebot commented on GitHub (Jun 7, 2014): Comment created by @doctrinebot: A related Github Pull-Request [GH-1052] was closed: https://github.com/doctrine/doctrine2/pull/1052
Author
Owner

@doctrinebot commented on GitHub (Jun 7, 2014):

Issue was closed with resolution "Won't Fix"

@doctrinebot commented on GitHub (Jun 7, 2014): Issue was closed with resolution "Won't Fix"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#3913