本文整理汇总了PHP中Album::setArtist方法的典型用法代码示例。如果您正苦于以下问题:PHP Album::setArtist方法的具体用法?PHP Album::setArtist怎么用?PHP Album::setArtist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Album
的用法示例。
在下文中一共展示了Album::setArtist方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateAction
public function updateAction()
{
$id = $this->params("id");
$album = new Album();
$album->setArtist("La vela puerca");
$album->setTitle("El viejo");
$album->setId($id);
$albumDao = new AlbumDao($this->_serviceLocator);
$res = $albumDao->save($album);
var_dump($res);
exit;
}
示例2: addAlbum
/**
* @param Album $album
*/
public function addAlbum($album)
{
$this->albums[] = $album;
$album->setArtist($this);
}
示例3: Album
<html>
<head>
<title>Albums</title>
</head>
<body>
<form method="POST" action="">
Enter the name of your artist:
<input type="text" name="artist"></input>
<input type="submit" name="submit" value="submit"></input>
</form>
<?php
require_once 'Album.php';
if (isset($_POST['artist']) && $_POST['artist'] != '') {
$myAlbum = new Album();
$myAlbum->setArtist($_POST['artist']);
echo "The name of the last album that you entered is: ";
$myAlbum->getArtist();
} else {
echo "You need to enter the name of your album before I can tell you what it is!";
}
?>
</body>
</html>