从连接表中推出数据不可用

I'm trying to show the first image of an imagealbum in a list. But when creating a query i cannot access the $album->getImageuri() method in the foreach loop.

$albums = \ApAlbumQuery::create()
            ->join('ApAlbum.ApAlbumImage', \Propel\Runtime\ActiveQuery\Criteria::LEFT_JOIN)
            ->join('ApAlbumImage.ApImage', \Propel\Runtime\ActiveQuery\Criteria::LEFT_JOIN)
            ->where('ApAlbum.visibility is not null')
            ->groupBy('ApAlbum.Id')
            ->orderByStartdate("ASC")
            ->find();

foreach($albums as $album)
{
    echo $album->getImageuri(); // not working?
}

When running the sql-query created with the Propel ->toString() method everything is present.

Anybody know what i'm doing wrong?

Try adding the ImageURI column using ->withColumn():

$albums = \ApAlbumQuery::create()
        ->join('ApAlbum.ApAlbumImage', \Propel\Runtime\ActiveQuery\Criteria::LEFT_JOIN)
        ->join('ApAlbumImage.ApImage', \Propel\Runtime\ActiveQuery\Criteria::LEFT_JOIN)
        ->withColumn('ApAlbumImage.ApImage.ImageURI')
        ->where('ApAlbum.visibility is not null')
        ->groupBy('ApAlbum.Id')
        ->orderByStartdate("ASC")
        ->find();

foreach($albums as $album)
{
    echo $album->getImageuri(); // not working?
}

From your ->join() syntax, I assume that your're using different schemata