本文整理匯總了PHP中Track::getId方法的典型用法代碼示例。如果您正苦於以下問題:PHP Track::getId方法的具體用法?PHP Track::getId怎麽用?PHP Track::getId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Track
的用法示例。
在下文中一共展示了Track::getId方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addInstanceToPool
/**
* Adds an object to the instance pool.
*
* Propel keeps cached copies of objects in an instance pool when they are retrieved
* from the database. In some cases -- especially when you override doSelect*()
* methods in your stub classes -- you may need to explicitly add objects
* to the cache in order to ensure that the same objects are always returned by doSelect*()
* and retrieveByPK*() calls.
*
* @param Track $value A Track object.
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
*/
public static function addInstanceToPool(Track $obj, $key = null)
{
if (Propel::isInstancePoolingEnabled()) {
if ($key === null) {
$key = (string) $obj->getId();
}
// if key === null
self::$instances[$key] = $obj;
}
}
示例2: setTrack
/**
* Declares an association between this object and a Track object.
*
* @param Track $v
* @return File The current object (for fluent API support)
* @throws PropelException
*/
public function setTrack(Track $v = null)
{
if ($v === null) {
$this->setTrackId(NULL);
} else {
$this->setTrackId($v->getId());
}
$this->aTrack = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the Track object, it will not be re-added.
if ($v !== null) {
$v->addFile($this);
}
return $this;
}
示例3: execute
/**
* Save track.
*/
function execute()
{
$schedConf =& Request::getSchedConf();
$trackDao =& DAORegistry::getDAO('TrackDAO');
if (isset($this->trackId)) {
$track =& $trackDao->getTrack($this->trackId);
}
if (!isset($track)) {
$track = new Track();
$track->setSchedConfId($schedConf->getId());
$track->setSequence(REALLY_BIG_NUMBER);
}
$track->setTitle($this->getData('title'), null);
// Localized
$track->setAbbrev($this->getData('abbrev'), null);
// Localized
$reviewFormId = $this->getData('reviewFormId');
if ($reviewFormId === '') {
$reviewFormId = null;
}
$track->setReviewFormId($reviewFormId);
$track->setMetaReviewed($this->getData('metaNotReviewed') ? 0 : 1);
$track->setIdentifyType($this->getData('identifyType'), null);
// Localized
$track->setDirectorRestricted($this->getData('directorRestriction') ? 1 : 0);
$track->setPolicy($this->getData('policy'), null);
// Localized
$track->setHideAbout($this->getData('hideAbout'));
$track->setDisableComments($this->getData('disableComments') ? 1 : 0);
$track->setAbstractWordCount($this->getData('wordCount'));
if ($track->getId() != null) {
$trackDao->updateTrack($track);
$trackId = $track->getId();
} else {
$trackId = $trackDao->insertTrack($track);
$trackDao->resequenceTracks($schedConf->getId());
}
// Save assigned directors
$trackDirectorsDao =& DAORegistry::getDAO('TrackDirectorsDAO');
$trackDirectorsDao->deleteDirectorsByTrackId($trackId, $schedConf->getId());
$directors = explode(':', Request::getUserVar('assignedDirectors'));
foreach ($directors as $edUserId) {
if (!empty($edUserId)) {
$trackDirectorsDao->insertDirector($schedConf->getId(), $trackId, $edUserId);
}
}
}
示例4: foreach
$log->add("saving {$xmlName} content to database...");
$result = $doc->getElementsByTagName("item");
// cada item corresponde a un album (o bundle en lenguaje netm)
if ($result->length > 0) {
// si tengo albums para recorrer
foreach ($result as $itemNumber => $xmlTrack) {
$xmlItem = $result->item($itemNumber);
if ($xmlItem->hasAttributes()) {
$track = new Track("brasil");
$track->setFromXML($xmlItem);
$saved = $track->save($dbc, "temas");
if ($saved === TRUE) {
// *************************
// OBTENGO DATOS DEL TRACK
$log->add("getting track id...");
$trackId = $track->getId();
// *************************
// *************************
// OBTENGO DATOS DEL ARTISTA
$log->add("getting artist id...");
if ($trackId != NULL) {
$artist = new Artist();
$log->add("searching db for artist=" . $track->getArtistName());
$artist->loadFromName($dbc, $track->getArtistName());
if ($artist->getMaches() == "1") {
$artistId = $artist->getId();
$log->add("found artist={$artistId}");
} else {
$log->add("artist not found");
$log->add("saving new artist info...");
$artist->setName($track->getArtistName());