We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Anyone study the files of example site album-o-rama?I got lost.

Anyone study the files of example site album-o-rama? I got lost in the file album-o-rama\apps\frontend\controllers\IndexController.php. Don't know when did the author defined the"al","ar","ap".

$phql = 'SELECT
al.id,
al.name,
ar.uri,
ar.id as artist_id,
ar.name as artist,
ap.url
FROM AlbumOrama\Models\Albums al
JOIN AlbumOrama\Models\Artists ar
JOIN AlbumOrama\Models\AlbumsPhotos ap
WHERE
al.id >= '.($offset * 30).' AND
ap.type = "large"
ORDER BY al.playcount DESC
LIMIT 30';
$albums = $this->modelsManager->executeQuery($phql);

$this->view->setVar('albums', $albums);


7.0k
Accepted
answer
FROM AlbumOrama\Models\Albums al
JOIN AlbumOrama\Models\Artists ar
JOIN AlbumOrama\Models\AlbumsPhotos ap

Line 10 11 and 12 ! It's an alias for the join



10.3k

Thank you very much.