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


PHP Tag::update_tag_list方法代码示例

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


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

示例1: update_tags

 /**
  * update_tags
  *
  * Update tags of tv shows
  */
 public function update_tags($tags_comma, $override_childs, $add_to_childs, $current_id = null, $force_update = false)
 {
     if ($current_id == null) {
         $current_id = $this->id;
     }
     Tag::update_tag_list($tags_comma, 'tvshow', $current_id, $force_update ? true : $override_childs);
     if ($override_childs || $add_to_childs) {
         $episodes = $this->get_episodes();
         foreach ($episodes as $ep_id) {
             Tag::update_tag_list($tags_comma, 'episode', $ep_id, $override_childs);
         }
     }
 }
开发者ID:bl00m,项目名称:ampache,代码行数:18,代码来源:tvshow.class.php

示例2: updateArtistTags

 /**
  * Updates artist tags from given song
  * @param Song $song
  */
 protected static function updateArtistTags(Song $song)
 {
     $tags = self::getSongTags('artist', $song->artist);
     Tag::update_tag_list(implode(',', $tags), 'artist', $song->artist, true);
 }
开发者ID:bl00m,项目名称:ampache,代码行数:9,代码来源:catalog.class.php

示例3: update

 /**
  * Update a broadcast from data array.
  * @param array $data
  * @return int
  */
 public function update(array $data)
 {
     if (isset($data['edit_tags'])) {
         Tag::update_tag_list($data['edit_tags'], 'broadcast', $this->id, true);
     }
     $sql = "UPDATE `broadcast` SET `name` = ?, `description` = ?, `is_private` = ? " . "WHERE `id` = ?";
     $params = array($data['name'], $data['description'], !empty($data['private']), $this->id);
     Dba::write($sql, $params);
     return $this->id;
 }
开发者ID:nioc,项目名称:ampache,代码行数:15,代码来源:broadcast.class.php

示例4: update

 public function update(array $data)
 {
     if (isset($data['edit_tags'])) {
         Tag::update_tag_list($data['edit_tags'], 'channel', $this->id, true);
     }
     $sql = "UPDATE `channel` SET `name` = ?, `description` = ?, `url` = ?, `interface` = ?, `port` = ?, `fixed_endpoint` = ?, `admin_password` = ?, `is_private` = ?, `max_listeners` = ?, `random` = ?, `loop` = ?, `stream_type` = ?, `bitrate` = ?, `object_id` = ? " . "WHERE `id` = ?";
     $params = array($data['name'], $data['description'], $data['url'], $data['interface'], $data['port'], !empty($data['interface']) && !empty($data['port']), $data['admin_password'], !empty($data['private']), $data['max_listeners'], $data['random'], $data['loop'], $data['stream_type'], $data['bitrate'], $data['object_id'], $this->id);
     Dba::write($sql, $params);
     return $this->id;
 }
开发者ID:cheese1,项目名称:ampache,代码行数:10,代码来源:channel.class.php

示例5: update_tags

 /**
  * update_tags
  *
  * Update tags of artists and/or albums
  */
 public function update_tags($tags_comma, $override_childs, $current_id = null)
 {
     if ($current_id == null) {
         $current_id = $this->id;
     }
     Tag::update_tag_list($tags_comma, 'artist', $current_id);
     if ($override_childs) {
         $albums = $this->get_albums(null, true);
         foreach ($albums as $album_id) {
             $album = new Album($album_id);
             $album->update_tags($tags_comma, $override_childs);
         }
     }
 }
开发者ID:axelsimon,项目名称:ampache,代码行数:19,代码来源:artist.class.php

示例6: update_tags

 /**
  * update_tags
  *
  * Update tags of albums and/or songs
  */
 public function update_tags($tags_comma, $override_songs, $current_id = null)
 {
     if ($current_id == null) {
         $current_id = $this->id;
     }
     Tag::update_tag_list($tags_comma, 'album', $current_id);
     if ($override_songs) {
         $songs = $this->get_songs();
         foreach ($songs as $song_id) {
             Tag::update_tag_list($tags_comma, 'song', $song_id);
         }
     }
 }
开发者ID:axelsimon,项目名称:ampache,代码行数:18,代码来源:album.class.php

示例7: update_tags

 /**
  * update_tags
  *
  * Update tags of albums and/or songs
  * @param string $tags_comma
  * @param boolean $override_childs
  * @param boolean $add_to_childs
  * @param int|null $current_id
  */
 public function update_tags($tags_comma, $override_childs, $add_to_childs, $current_id = null, $force_update = false)
 {
     if ($current_id == null) {
         $current_id = $this->id;
     }
     // When current_id not empty we force to overwrite current object
     Tag::update_tag_list($tags_comma, 'album', $current_id, $force_update ? true : $override_childs);
     if ($override_childs || $add_to_childs) {
         $songs = $this->get_songs();
         foreach ($songs as $song_id) {
             Tag::update_tag_list($tags_comma, 'song', $song_id, $override_childs);
         }
     }
 }
开发者ID:bl00m,项目名称:ampache,代码行数:23,代码来源:album.class.php

示例8: update

 /**
  * update
  * This takes a key'd array of data as input and updates a video entry
  * @param array $data
  * @return int
  */
 public function update(array $data)
 {
     if (isset($data['release_date'])) {
         $f_release_date = $data['release_date'];
         $release_date = strtotime($f_release_date);
     } else {
         $release_date = $this->release_date;
     }
     $title = isset($data['title']) ? $data['title'] : $this->title;
     $sql = "UPDATE `video` SET `title` = ?, `release_date` = ? WHERE `id` = ?";
     Dba::write($sql, array($title, $release_date, $this->id));
     if (isset($data['edit_tags'])) {
         Tag::update_tag_list($data['edit_tags'], 'video', $this->id, true);
     }
     $this->title = $title;
     $this->release_date = $release_date;
     return $this->id;
 }
开发者ID:ivan801,项目名称:ampache,代码行数:24,代码来源:video.class.php

示例9: update

 /**
  * update
  * This takes a key'd array of data does any cleaning it needs to
  * do and then calls the helper functions as needed.
  * @param array $data
  * @return int
  */
 public function update(array $data)
 {
     foreach ($data as $key => $value) {
         debug_event('song.class.php', $key . '=' . $value, '5');
         switch ($key) {
             case 'artist_name':
                 // Need to create new artist according the name
                 $new_artist_id = Artist::check($value);
                 $this->artist = $new_artist_id;
                 self::update_artist($new_artist_id, $this->id);
                 break;
             case 'album_name':
                 // Need to create new album according the name
                 $new_album_id = Album::check($value);
                 $this->album = $new_album_id;
                 self::update_album($new_album_id, $this->id);
                 break;
             case 'year':
             case 'title':
             case 'track':
             case 'artist':
             case 'album':
             case 'mbid':
             case 'license':
             case 'composer':
             case 'label':
             case 'language':
             case 'comment':
                 // Check to see if it needs to be updated
                 if ($value != $this->{$key}) {
                     $function = 'update_' . $key;
                     self::$function($value, $this->id);
                     $this->{$key} = $value;
                 }
                 break;
             case 'edit_tags':
                 Tag::update_tag_list($value, 'song', $this->id, true);
                 $this->tags = Tag::get_top_tags('song', $this->id);
                 break;
             default:
                 break;
         }
         // end whitelist
     }
     // end foreach
     $this->write_id3();
     return $this->id;
 }
开发者ID:nioc,项目名称:ampache,代码行数:55,代码来源:song.class.php

示例10: update

 /**
  * update
  * This takes a key'd array of data does any cleaning it needs to
  * do and then calls the helper functions as needed.
  */
 public function update($data)
 {
     foreach ($data as $key => $value) {
         debug_event('song.class.php', $key . '=' . $value, '5');
         switch ($key) {
             case 'artist_name':
                 // Need to create new artist according the name
                 $new_artist_id = Artist::check($value);
                 self::update_artist($new_artist_id, $this->id);
                 break;
             case 'album_name':
                 // Need to create new album according the name
                 $new_album_id = Album::check($value);
                 self::update_album($new_album_id, $this->id);
                 break;
             case 'title':
             case 'track':
             case 'artist':
             case 'album':
             case 'mbid':
                 // Check to see if it needs to be updated
                 if ($value != $this->{$key}) {
                     $function = 'update_' . $key;
                     self::$function($value, $this->id);
                     $this->{$key} = $value;
                 }
                 break;
             case 'edit_tags':
                 Tag::update_tag_list($value, 'song', $this->id);
                 break;
             default:
                 break;
         }
         // end whitelist
     }
     // end foreach
     return true;
 }
开发者ID:axelsimon,项目名称:ampache,代码行数:43,代码来源:song.class.php


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