View Snippet #207

    namespace app\models;

use Yii;
use yii\helpers\Html;

/**
 * This is the model class for table "photos".
 *
 */
class Photo extends \yii\db\ActiveRecord
    /**
    * @return \yii\db\ActiveQuery
    */
    public function getAlbums()
    {
        return $this->hasOne(Album::className(), ['id' => 'album_id';]);
    }