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


PHP Track类代码示例

本文整理汇总了PHP中Track的典型用法代码示例。如果您正苦于以下问题:PHP Track类的具体用法?PHP Track怎么用?PHP Track使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Track类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: transform

 /**
  * @param \SimpleXMLElement $xml
  * @return Track
  */
 public function transform(\SimpleXMLElement $xml)
 {
     $track = new Track();
     $track->setArtist((string) $xml->artist);
     $track->setTitle((string) $xml->title);
     return $track;
 }
开发者ID:samwalshnz,项目名称:nexgen-api,代码行数:11,代码来源:FetcherTrackTransformer.php

示例2: addtrackAction

 public function addtrackAction()
 {
     $form = new App_Form_NewTrack();
     if (!empty($_POST) && $form->isValid($_POST)) {
         $artists = new App_Table_Artist();
         //--------------------------------
         // Check the file info, and save
         //--------------------------------
         $track = new Track();
         $track->title = $form->getValue('title');
         $track->artistId = $this->_artist->id;
         $track->releaseId = $form->getValue('releaseId');
         $track->single = true;
         $track->publishDate = $form->getValue('publishDate');
         $track->save();
         $this->_flash->addMessage('Your track info has been saved.');
         $file = new TrackFile();
         $file->trackId = $track->id;
         $file->fileName = $form->audioFile->getFileName();
         $file->mimeType = mime_content_type($file->fileName);
         $file->save();
         $track->originalFileId = $file->id;
         $track->save();
         $this->_flash->addMessage('The audio file for your track has been scheduled for injestion.  Once the file has been injested, it will be available on the site.');
         $form = new App_Form_NewTrack();
     }
     $form->setDefault('releaseId', $this->_request->getParam('releaseId'));
     $form->setMethod('post');
     $form->setAction('/dashboard/catalog/addtrack');
     $this->view->form = $form;
 }
开发者ID:ajbrown,项目名称:bitnotion,代码行数:31,代码来源:CatalogController.php

示例3: showHistoryGetEntry

 function showHistoryGetEntry()
 {
     require_once "track.php";
     $track = new Track("", "", "");
     $entry = $track->getEntry(loadvar("trid"));
     return $entry["value"];
     exit;
 }
开发者ID:nubissurveying,项目名称:nubis,代码行数:8,代码来源:smsajax.php

示例4: removeTrack

 public function removeTrack(Track $track)
 {
     foreach ($this->tracks as $k => $v) {
         if ($v->getNumber() == $track->getNumber()) {
             array_splice($this->tracks, $k, 1);
         }
     }
     $track->clear();
 }
开发者ID:stdtabs,项目名称:phptabs,代码行数:9,代码来源:Song.php

示例5: track

 /**
  * store in db action
  *
  * @return array
  */
 protected function track($action, $model, $id)
 {
     $track = new Track();
     $track->auth_id = Auth::user()->id;
     $track->date = new Datetime();
     $track->action = $action;
     $track->trackable_id = $id;
     $track->trackable_type = $model;
     return $track->save();
 }
开发者ID:Metrakit,项目名称:dynamix,代码行数:15,代码来源:BaseController.php

示例6: scanFile

 /**
  * scan a file for music
  *
  * @param string $path
  * @return boolean
  */
 public function scanFile($path)
 {
     $mimeType = \OC\Files\Filesystem::getMimeType($path);
     if ($mimeType === 'application/ogg' or substr($mimeType, 0, 5) === 'audio') {
         $track = new Track($path);
         $data = $track->getTags();
         if (!empty($data)) {
             $artistId = $this->collection->addArtist($data['artist']);
             $albumId = $this->collection->addAlbum($data['album'], $artistId);
             $this->collection->addSong($data['title'], $path, $artistId, $albumId, $data['length'], $data['track'], $data['size']);
         }
     }
     return true;
 }
开发者ID:CDN-Sparks,项目名称:owncloud,代码行数:20,代码来源:scanner.php

示例7: testRemoveTrackFromAlbum

 public function testRemoveTrackFromAlbum()
 {
     $album = Album::create('id', 'Album name');
     $album->addTrack(Track::create('id', 'Track name'));
     $album->removeTrack(Track::create('id', 'Track name'));
     $this->assertCount(0, $album->getTracks());
 }
开发者ID:alexgt9,项目名称:PlayCool,代码行数:7,代码来源:AlbumTest.php

示例8: admin

 private function admin()
 {
     $today = strtotime('today');
     $month = strtotime('first day of this month');
     $last30 = strtotime('-30 days');
     // Users statistics
     $users['today'] = number_format(User::whereGt('reg_date', $today)->count());
     $users['month'] = number_format(User::whereGt('reg_date', $month)->count());
     $users['last30'] = number_format(User::whereGt('reg_date', $last30)->count());
     $users['total'] = number_format(User::count());
     View::set('users', $users);
     // Playlists statistics
     $playlists['today'] = number_format(Playlist::whereGt('date', $today)->count());
     $playlists['month'] = number_format(Playlist::whereGt('date', $month)->count());
     $playlists['last30'] = number_format(Playlist::whereGt('date', $last30)->count());
     $playlists['total'] = number_format(Playlist::count());
     View::set('playlists', $playlists);
     // Tracks statistics
     $tracks = number_format(Track::count());
     View::set('tracks', $tracks);
     // Tags statistics
     $tags = number_format(Tag::count());
     View::set('tags', $tags);
     // Comments statistics
     $comments = number_format(Comment::count());
     View::set('comments', $comments);
     // Likes
     $likes = number_format(PlaylistLike::count());
     View::set('likes', $likes);
     // Reports
     $reports = number_format(Report::count());
     View::set('reports', $reports);
     View::show('admin/admin');
 }
开发者ID:nytr0gen,项目名称:plur-music-explorer,代码行数:34,代码来源:admin.php

示例9: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $latitud = Input::get('latitud', 0);
     $longitud = Input::get('longitud', 0);
     // DB::table('tracks')->insert( array(
     // 	'latitud' => $latitud,
     // 	'longitud' => $longitud
     // ));
     $track = new Track();
     $track->latitud = $latitud;
     $track->longitud = $longitud;
     $track->save();
     $respuesta = array("state" => "ok", "message" => "todo ok");
     // $personas = Persona::all();
     return json_encode($respuesta);
 }
开发者ID:keloxers,项目名称:urbano,代码行数:21,代码来源:TrakingsController.php

示例10: onArticleSaveComplete

 public static function onArticleSaveComplete($article, $user, $revision, $status)
 {
     wfProfileIn(__METHOD__);
     $insertedImages = Wikia::getVar('imageInserts');
     $imageDeletes = Wikia::getVar('imageDeletes');
     $changedImages = $imageDeletes;
     foreach ($insertedImages as $img) {
         $changedImages[$img['il_to']] = true;
     }
     $sendTrackEvent = false;
     foreach ($changedImages as $imageDBName => $dummy) {
         $title = Title::newFromDBkey($imageDBName);
         if (!empty($title)) {
             $mq = new self($title);
             $mq->unsetCache();
             $sendTrackEvent = true;
         }
     }
     // send track event if embed change
     if ($sendTrackEvent) {
         Track::event('embed_change');
     }
     wfProfileOut(__METHOD__);
     return true;
 }
开发者ID:yusufchang,项目名称:app,代码行数:25,代码来源:ArticlesUsingMediaQuery.class.php

示例11: update_schema

 /**
  * Create/update schema in database.
  */
 public static function update_schema()
 {
     global $wpdb;
     $sql = "\n\n        CREATE TABLE " . Track::table_name() . " (\n            id int(11) NOT NULL AUTO_INCREMENT,\n            stream_title varchar(200) NOT NULL,\n            track_key varchar(200) NOT NULL,\n            artist varchar(100) NOT NULL,\n            title varchar(100) NOT NULL,\n            play_count int(11) NOT NULL,\n            vote_count int(11) NOT NULL,\n            vote_total int(11) DEFAULT NULL,\n            vote_average double DEFAULT NULL,\n            PRIMARY KEY (id),\n            UNIQUE KEY (track_key),\n            KEY (vote_average),\n            KEY (play_count),\n            KEY (vote_count),\n            KEY (vote_total)\n        ) CHARACTER SET utf8;\n\n        CREATE TABLE " . Play::table_name() . " (\n            id int(11) NOT NULL AUTO_INCREMENT,\n            time_utc datetime NOT NULL,\n            track_id int(11) NOT NULL,\n            stream_title varchar(200) NOT NULL,\n            PRIMARY KEY (id),\n            KEY (track_id),\n            KEY (time_utc),\n            CONSTRAINT " . Play::table_name() . "_ibfk_1 FOREIGN KEY (track_id) REFERENCES " . Track::table_name() . " (id)\n        ) CHARACTER SET utf8;\n\n        CREATE TABLE " . Vote::table_name() . " (\n            id int(11) NOT NULL AUTO_INCREMENT,\n            time_utc datetime NOT NULL,\n            track_id int(11) NOT NULL,\n            stream_title varchar(200) NOT NULL,\n            value tinyint(4) NOT NULL,\n            nick varchar(30) NOT NULL,\n            user_id varchar(150) NOT NULL,\n            is_authed bit(1) NOT NULL,\n            deleted tinyint(4) NOT NULL DEFAULT '0',\n            comment varchar(200) NULL,\n            PRIMARY KEY (id),\n            KEY (track_id),\n            KEY (time_utc),\n            KEY (nick),\n            CONSTRAINT " . Vote::table_name() . "_ibfk_1 FOREIGN KEY (track_id) REFERENCES " . Track::table_name() . " (id)\n        ) CHARACTER SET utf8;\n\n        ";
     require_once ABSPATH . 'wp-admin/includes/upgrade.php';
     dbDelta($sql);
 }
开发者ID:loonix,项目名称:music-stream-vote,代码行数:10,代码来源:Db.php

示例12: buyTrack

 public function buyTrack($trackid, $albumid)
 {
     $userid = $this->session->userdata('userid');
     $result = array("error" => FALSE);
     if (!$userid) {
         $result["error"] = "You must login!";
         echo json_encode($result);
     }
     $user = new User($userid);
     $track = Track::loadTrack($trackid);
     if ($user->getCredit() < $track->getCost()) {
         //The user can't afford the track!
         $result["error"] = "You have insufficient funds to buy the track as it costs &pound;" . sprintf("%01.2f", $track->getCost() / 100) . ", please top up your account";
         echo json_encode($result);
     } else {
         //Buy the rights to the track
         if ($user->aquireRightsToTrack($trackid, $albumid)) {
             //The track was bought successfully
             $result["bought"] = TRUE;
         } else {
             $result["error"] = "Sorry, there was a problem buying the track. Please try again later";
         }
         echo json_encode($result);
     }
 }
开发者ID:bennetimo,项目名称:comp3013,代码行数:25,代码来源:accountmanager.php

示例13: getTopTracks

 /** Get the most popular tracks on last.fm by country.
  *
  * @param	string	country		A country name, as defined by the ISO 3166-1 country names standard. (Required)
  * @param	string	location	A metro name, to fetch the charts for (must be within the country specified). (Optional)
  * @return	array				An array of Track objects.
  *
  * @static
  * @access	public
  * @throws	Error
  */
 public static function getTopTracks($country, $location = null)
 {
     $xml = CallerFactory::getDefaultCaller()->call('geo.getTopTracks', array('country' => $country, 'location' => $location));
     $tracks = array();
     foreach ($xml->children() as $track) {
         $tracks[] = Track::fromSimpleXMLElement($track);
     }
     return $tracks;
 }
开发者ID:niczak,项目名称:php-last.fm-api,代码行数:19,代码来源:Geo.php

示例14: __construct

 public function __construct($url, $arguments, $accept)
 {
     parent::__construct($url, $arguments, $accept);
     // set the queryTrackId and queryTrackExternal_Key Values
     $this->queryFileExternal_Key = $this->queryParameterId;
     $this->queryFileId = $this->getIDfromExternalKey($this->queryFileExternal_Key);
     $this->queryFileGUID = $this->getGUIDfromID($this->queryFileId);
     // always include external_key Values in the Result
     $this->external_keys = true;
 }
开发者ID:EQ4,项目名称:smafe,代码行数:10,代码来源:TrackExternalKey.php

示例15: index

 function index()
 {
     $this->load->static_model('Track');
     //$this->load->view('welcome_message');
     $search_res = Track::searchByGenre("opera");
     //$data = array('search_res' => $search_res);
     //$this->load->view('search', $data);
     $t = $search_res[0];
     print_r($t->getArtist()->getTracks());
     /*foreach( as $t){
     			echo $t->getName().", artist: ".$t->getArtist()->getName().", album: ".$t->getAlbum()->getName().", genres: ";
     			print_r($t->getGenres());
     			echo ", videos: ";
     			print_r($t->getVideos())."<br />";
     		}*/
 }
开发者ID:bennetimo,项目名称:comp3013,代码行数:16,代码来源:welcome.php


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