当前位置: 首页>>代码示例>>PHP>>正文


PHP Track::getId方法代码示例

本文整理汇总了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;
     }
 }
开发者ID:EQ4,项目名称:smint,代码行数:22,代码来源:BaseTrackPeer.php

示例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;
 }
开发者ID:EQ4,项目名称:smint,代码行数:22,代码来源:BaseFile.php

示例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);
         }
     }
 }
开发者ID:ramonsodoma,项目名称:ocs,代码行数:50,代码来源:TrackForm.inc.php

示例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());
开发者ID:vallejos,项目名称:samples,代码行数:31,代码来源:sync-tracks.php


注:本文中的Track::getId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。