/** * Returns a new AlbumQuery object. * * @param string $modelAlias The alias of a model in the query * @param AlbumQuery|Criteria $criteria Optional Criteria to build the query from * * @return AlbumQuery */ public static function create($modelAlias = null, $criteria = null) { if ($criteria instanceof AlbumQuery) { return $criteria; } $query = new AlbumQuery(); if (null !== $modelAlias) { $query->setModelAlias($modelAlias); } if ($criteria instanceof Criteria) { $query->mergeWith($criteria); } return $query; }
public function indexAction() { return new ViewModel(array('albums' => AlbumQuery::create()->find())); }
/** * Get the associated Album object * * @param PropelPDO $con Optional Connection object. * @param $doQuery Executes a query to get the object if required * @return Album The associated Album object. * @throws PropelException */ public function getAlbum(PropelPDO $con = null, $doQuery = true) { if ($this->aAlbum === null && $this->album_id !== null && $doQuery) { $this->aAlbum = AlbumQuery::create()->findPk($this->album_id, $con); /* The following can be used additionally to guarantee the related object contains a reference to this object. This level of coupling may, however, be undesirable since it could result in an only partially populated collection in the referenced object. $this->aAlbum->addSongss($this); */ } return $this->aAlbum; }