Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-3157

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

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      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;

        Activity

        Hide
        Doctrine Bot added a comment -

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

        Show
        Doctrine Bot added a comment - A related Github Pull-Request [GH-1052] was closed: https://github.com/doctrine/doctrine2/pull/1052

          People

          • Assignee:
            Marco Pivetta
            Reporter:
            Doctrine Bot
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: