Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-1801

Update ReportType interface to support returning Iterator

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.0-b1
    • Component/s: None
    • Labels:
      None

      Description

      The ReportType interface, used in generating reports, should return an implementation of Iterator (currently documented as PDOStatement). This isn't a problem since PDOStatement implements Iterator.

      Additionally, the ReportManager, which uses reports of the ReportType interface must be updated to iterate using foreach instead of while, with no PDOStatment specific method calls, and support returning an Iterator object instead of PDOStatement.

      This will allow reports to be generated using any iteratable object, whether they be PDOStatement or ArrayObject, etc. This vastly improves the capabilities of the report system.

      To recap:

      1. Update ReportType interface doc to use Iterator instead of PDOStatement
      2. Update ReportManager::fetchAll doc to use Iterator instead of PDOStatement
      3. Update ReportManager::fetchAll to use foreach instead of while

        Activity

        Hide
        cody Cody Phillips (Inactive) added a comment -

        Note that PDOStatement isn't technically an Iterator. It's Traversable.

        So we really should convert all reports to return instances of Iterator by converting PDOStatement using IteratorIterator.

        Show
        cody Cody Phillips (Inactive) added a comment - Note that PDOStatement isn't technically an Iterator. It's Traversable. So we really should convert all reports to return instances of Iterator by converting PDOStatement using IteratorIterator.

          People

          • Assignee:
            cody Cody Phillips (Inactive)
            Reporter:
            cody Cody Phillips (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              28/Sep/15

              Agile