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


PHP Track::create方法代码示例

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


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

示例1: 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

示例2: search

 /**
  * Gets track by url
  * @param  string $url
  * @return string
  */
 public static function search($query)
 {
     // create a client object with your app credentials
     $client = new Services_Soundcloud(Base::$g['soundcloud_client'], '');
     // find all sounds
     $tracks = $client->get('tracks', array('q' => $query, 'limit' => 40));
     $tracks = json_decode($tracks);
     $ret = array();
     foreach ($tracks as $track) {
         $table = Track::create();
         $table->scid = $track->id;
         $table->name = $track->title;
         $table->scurl = $track->permalink_url;
         $table->duration = round($track->duration / 1000);
         $table->save();
         $ret[] = $table->orm->asArray();
     }
     return $ret;
 }
开发者ID:nytr0gen,项目名称:plur-music-explorer,代码行数:24,代码来源:Soundcloud.php

示例3: isset

<script type="text/javascript">
$(document).ready(function(){

});
</script>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
  <link rel="stylesheet" href="bootstrap-select.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
  <script src="bootstrap-select.js"></script>
<?php 
include 'models.php';
$track = isset($_GET['id']) ? Track::find($_GET['id']) : Track::create(null, null, 0, 0, 0, 1);
?>



	
</head>
<body>
<div class="jumbotron" >
<div class="container"><?php 
if (isset($track->TrackId)) {
    ?>
			<h1>Track</h1>
			<?php 
} else {
    ?>
开发者ID:stealthrob,项目名称:Dangerous_Eagle,代码行数:31,代码来源:track.php

示例4: intval

<?php

include 'models.php';
if (isset($_POST['id'])) {
    $a = Track::find($_POST['id']);
    $a->Name = $_POST['name'];
    $a->Album = intval($_POST['album']);
    $a->Composer = $_POST['composer'];
    $a->Milliseconds = $_POST['milliseconds'];
    $a->Bytes = $_POST['bytes'];
    $a->UnitPrice = $_POST['unitprice'];
    if ($a->save()) {
        header("Location: " . "../index.php?id=" . $a->TrackId);
    }
} else {
    $a = Track::create($_POST['name'], $_POST['composer'], $_POST['milliseconds'], $_POST['bytes'], $_POST['unitprice'], intval($_POST['album']));
    if ($a->save()) {
        header("Location: " . "../index.php?id=" . $a->TrackId);
    }
}
开发者ID:dev2me,项目名称:music2.com,代码行数:20,代码来源:guardar_track.php


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