本文整理汇总了PHP中Track::setId方法的典型用法代码示例。如果您正苦于以下问题:PHP Track::setId方法的具体用法?PHP Track::setId怎么用?PHP Track::setId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Track
的用法示例。
在下文中一共展示了Track::setId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildTrack
/**
* Create a track object from result
*
* @param object $item
* @param AlbumSimplified $album
* @param array $artists
*
* @return Track
*/
public function buildTrack($item, AlbumSimplified $album, array $artists)
{
$track = new Track();
$track->setId($item->id)->setName($item->name)->setSpotifyUri($item->uri)->setSpotifyHref($item->href)->setAlbum($album)->setArtists($artists);
return $track;
}
示例2: Track
/**
* Internal function to return a Track object from a row.
* @param $row array
* @return Track
*/
function &_returnTrackFromRow(&$row)
{
$track = new Track();
$track->setId($row['track_id']);
$track->setSchedConfId($row['sched_conf_id']);
$track->setReviewFormId($row['review_form_id']);
$track->setSequence($row['seq']);
$track->setMetaReviewed($row['meta_reviewed']);
$track->setDirectorRestricted($row['director_restricted']);
$track->setHideAbout($row['hide_about']);
$track->setDisableComments($row['disable_comments']);
$track->setAbstractWordCount($row['abstract_word_count']);
$this->getDataObjectSettings('track_settings', 'track_id', $row['track_id'], $track);
HookRegistry::call('TrackDAO::_returnTrackFromRow', array(&$track, &$row));
return $track;
}
示例3: handleTrackNode
//.........这里部分代码省略.........
// existing track, but not the same track, throw an error.
$track = null;
$foundTrackId = $foundTrackTitle = null;
$index = 0;
foreach ($titles as $locale => $title) {
$track = $trackDao->getTrackByTitle($title, $schedConf->getId());
if ($track) {
$trackId = $track->getId();
if ($foundTrackId) {
if ($foundTrackId != $trackId) {
// Mismatching tracks found. Throw an error.
$errors[] = array('plugins.importexport.native.import.error.trackTitleMismatch', array('track1Title' => $title, 'track2Title' => $foundTrackTitle));
return false;
}
} else {
if ($index > 0) {
// the current title matches, but the prev titles didn't => error
$errors[] = array('plugins.importexport.native.import.error.trackTitleMatch', array('trackTitle' => $title));
return false;
}
}
$foundTrackId = $trackId;
$foundTrackTitle = $title;
} else {
if ($foundTrackId) {
// a prev title matched, but the current doesn't => error
$errors[] = array('plugins.importexport.native.import.error.trackTitleMatch', array('trackTitle' => $foundTrackTitle));
return false;
}
}
$index++;
}
// check abbrevs:
$abbrevTrack = null;
$foundTrackId = $foundTrackAbbrev = null;
$index = 0;
foreach ($abbrevs as $locale => $abbrev) {
$abbrevTrack = $trackDao->getTrackByAbbrev($abbrev, $schedConf->getId());
if ($abbrevTrack) {
$trackId = $abbrevTrack->getId();
if ($foundTrackId) {
if ($foundTrackId != $trackId) {
// Mismatching tracks found. Throw an error.
$errors[] = array('plugins.importexport.native.import.error.trackAbbrevMismatch', array('track1Abbrev' => $abbrev, 'track2Abbrev' => $foundTrackAbbrev));
return false;
}
} else {
if ($index > 0) {
// the current abbrev matches, but the prev abbrevs didn't => error
$errors[] = array('plugins.importexport.native.import.error.trackAbbrevMatch', array('trackAbbrev' => $trackAbbrev));
return false;
}
}
$foundTrackId = $trackId;
$foundTrackAbbrev = $abbrev;
} else {
if ($foundTrackId) {
// a prev abbrev matched, but the current doesn't => error
$errors[] = array('plugins.importexport.native.import.error.trackAbbrevMatch', array('trackAbbrev' => $foundTrackAbbrev));
return false;
}
}
$index++;
}
if (!$track && !$abbrevTrack) {
// The track was not matched. Create one.
// Note that because tracks are global-ish,
// we're not maintaining a list of created
// tracks to delete in case the import fails.
unset($track);
$track = new Track();
$track->setTitle($titles, null);
$track->setAbbrev($abbrevs, null);
$track->setIdentifyType($identifyTypes, null);
$track->setPolicy($policies, null);
$track->setSchedConfId($schedConf->getId());
$track->setSequence(REALLY_BIG_NUMBER);
$track->setMetaIndexed(1);
$track->setEditorRestricted(1);
$track->setId($trackDao->insertTrack($track));
$trackDao->resequenceTracks($schedConf > getSchedConfId());
}
if (!$track && $abbrevTrack) {
unset($track);
$track =& $abbrevTrack;
}
// $track *must* now contain a valid track, whether it was
// found amongst existing tracks or created anew.
$hasErrors = false;
for ($index = 0; $node = $trackNode->getChildByName('paper', $index); $index++) {
if (!NativeImportDom::handlePaperNode($conference, $schedConf, $node, $track, $paper, $publishedPaper, $paperErrors, $user, $isCommandLine, $dependentItems)) {
$errors = array_merge($errors, $paperErrors);
$hasErrors = true;
}
}
if ($hasErrors) {
return false;
}
return true;
}