本文整理汇总了PHP中Song::getTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP Song::getTitle方法的具体用法?PHP Song::getTitle怎么用?PHP Song::getTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Song
的用法示例。
在下文中一共展示了Song::getTitle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFileSafeTitle
/**
* File/Folder safe name of song
*
* @return string
* @throws SMException
*/
public function getFileSafeTitle()
{
if (empty($this->song)) {
throw new SMException('Song myst be set');
}
return Utility::GenerateSafeFileName($this->song->getTitle());
}
示例2: Song
<?php
require_once "config/config.inc";
$db = $_SESSION['db'];
$stmt = $db->prepare("select id from song;");
$stmt->execute();
while ($s = $stmt->fetch(PDO::FETCH_NUM)) {
$song = new Song($s[0]);
$lyrics = Song::getLyricsFromAPI($song->getMainArtist(), $song->getTitle());
$stmt2 = $db->prepare("update song set lyrics = :lyrics where id = :id;");
$stmt2->bindParam("lyrics", $lyrics, PDO::PARAM_STR);
$stmt2->bindParam("id", $s, PDO::PARAM_INT);
if ($stmt2->execute()) {
print 1;
} else {
print 0;
}
$stmt2->closeCursor();
}
$stmt->closeCursor();