Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-27473

As a Developer I'd like methods to check if a Version is Draft/Published/Archived

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.11.0
    • Component/s: None
    • Labels:
      None

      Description

      As a Developer I'd like methods to check if a Version is Draft/Published/Archived to not have to check using the constants.

      This is already on the Location object in API, and can be added in same way on VersionInfo.

      Here is how it looks like in Location:

          /**
           * Returns true if current location is a draft.
           *
           * @return bool
           */
          public function isDraft()
          {
              return $this->status === self::STATUS_DRAFT;
          }
      
      

      Class to contribute to (bottom, propoerties first): https://github.com/ezsystems/ezpublish-kernel/blob/master/eZ/Publish/API/Repository/Values/Content/VersionInfo.php

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            andre.romcke@ez.no André Rømcke
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: