Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1492

Fatall error: Cannot use object as array in ORM\Internal\Hydration\ObjectHydrator.php on line 314

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.1.1
    • Fix Version/s: 2.2
    • Component/s: None
    • Security Level: All
    • Labels:
      None
    • Environment:
      Symfony2, Doctrine 2.1.1 (also bug present on 2.1.3-dev - latest revison of 2.1.x branch)

      Description

      My entities

      event
      eveht.event_area_id=event_area.id (1:1)
      event_area.event_id=event.id (1:1)
      event_area.area.id=area.id (one area has many event_area's)
      area.parent_id=area_id (hierarchial)
      event.author_id=user.id (one user has many events)

      area - STI: District/City/Region/Country/etc.

      SELECT
      	r, ra, a, ap, au, DATE(r.eventTime) AS event_date
      FROM OloloEventsBundle:Event r
      	LEFT JOIN r.eventArea ra
      		LEFT JOIN ra.area a
      			LEFT JOIN a.parent ap
      	INNER JOIN r.author au WHERE r.eventTime <= :r_eventtime AND ra.area IN(:ra_area)
      GROUP BY r
      ORDER BY event_date DESC
      

      This DQL caused an error "Cannot use object of type District as array in ORM\Internal\Hydration\ObjectHydrator.php on line 314". When I'm removing `ap` friom fetching - it works. Mapping are correct - there are many other places where it works correctly.

        Activity

        Konstantin created issue -
        Konstantin made changes -
        Field Original Value New Value
        Description My entities

        event
        eveht.event_area_id=event_area.id (1:1)
        event_area.event_id=event.id (1:1)
        event_area.area.id=area.id (one area has many event_area's)
        area.parent_id=area_id (hierarchial)
        event.author_id=user.id (one user has many events)

        area - STI: District/City/Region/Country/etc.

        {code}
        SELECT
        r, ra, a, ap, au, DATE(r.eventTime) AS event_date
        FROM OloloRidesBundle:Ride r
        LEFT JOIN r.eventArea ra
        LEFT JOIN ra.area a
        LEFT JOIN a.parent ap
        INNER JOIN r.author au WHERE r.eventTime <= :r_eventtime AND ra.area IN(:ra_area)
        GROUP BY r
        ORDER BY event_date DESC
        {code}

        This DQL caused an error "Cannot use object of type District as array in ORM\Internal\Hydration\ObjectHydrator.php on line 314". When I'm removing `ap` friom fetching - it works. Mapping are correct - there are many other places where it works correctly.
        My entities

        event
        eveht.event_area_id=event_area.id (1:1)
        event_area.event_id=event.id (1:1)
        event_area.area.id=area.id (one area has many event_area's)
        area.parent_id=area_id (hierarchial)
        event.author_id=user.id (one user has many events)

        area - STI: District/City/Region/Country/etc.

        {code}
        SELECT
        r, ra, a, ap, au, DATE(r.eventTime) AS event_date
        FROM OloloEventsBundle:Event r
        LEFT JOIN r.eventArea ra
        LEFT JOIN ra.area a
        LEFT JOIN a.parent ap
        INNER JOIN r.author au WHERE r.eventTime <= :r_eventtime AND ra.area IN(:ra_area)
        GROUP BY r
        ORDER BY event_date DESC
        {code}

        This DQL caused an error "Cannot use object of type District as array in ORM\Internal\Hydration\ObjectHydrator.php on line 314". When I'm removing `ap` friom fetching - it works. Mapping are correct - there are many other places where it works correctly.
        Guilherme Blanco made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Benjamin Eberlei [ beberlei ] Guilherme Blanco [ guilhermeblanco ]
        Fix Version/s 2.2-DEV [ 10157 ]
        Resolution Fixed [ 1 ]
        Benjamin Eberlei made changes -
        Workflow jira [ 13184 ] jira-feedback [ 15114 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 15114 ] jira-feedback2 [ 16978 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 16978 ] jira-feedback3 [ 19231 ]

          People

          • Assignee:
            Guilherme Blanco
            Reporter:
            Konstantin
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: