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


PHP Zend_Rest_Client::inc方法代码示例

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


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

示例1: get_artist_relat

 /**
  *
  * @param <type> $pID
  * @return <type>
  */
 public static function get_artist_relat($pID)
 {
     $client = new Zend_Rest_Client("http://musicbrainz.org/ws/1/artist/" . $pID);
     $client->inc('artist-rels release-rels');
     $client->type('xml');
     return self::digest_artist_list($client->get());
 }
开发者ID:BGCX262,项目名称:zupal-svn-to-git,代码行数:12,代码来源:MusicBrains.php

示例2: load_from_mb

 /**
  *
  * @param boolean $pInclude_relations)
  * @return boolean
  */
 public function load_from_mb($pID)
 {
     $client = new Zend_Rest_Client("http://musicbrainz.org/ws/1/artist/" . $pID);
     $client->inc('artist-rels release-rels');
     $client->type('xml');
     $result = $client->get();
     if ($result->artist) {
         $artist_node = $result->artist;
         $attrs = $artist_node->attributes();
         $type = (string) $attrs['type'];
         $id_field = $this->table()->idField();
         $this->table()->getAdapter()->query('REPLACE INTO ' . $this->table()->tableName() . '(' . $id_field . ') values (?)', array($pID));
         $select = $this->table()->select()->where('mb_id LIKE ?', array($pID));
         $this->_row = $this->table()->fetchRow($select);
         $this->type = strtolower($type);
         $relations = array();
         foreach ($artist_node->children() as $ele_name => $element) {
             switch ($ele_name) {
                 case 'life-span':
                     foreach ($element->attributes() as $life_prop => $life_value) {
                         $life_prop = strtolower($life_prop);
                         switch ($life_prop) {
                             case 'begin':
                             case 'end':
                                 $this->{$life_prop} = (string) $life_value;
                         }
                     }
                     break;
                 case 'name':
                     $this->name = (string) $element;
                     break;
                 case 'sort-name':
                     // don't care
                     break;
                 case 'relation-list':
                     $list = Zupal_Media_Musicbrains_Relations::digest_list($element, $pID, 'artist');
                     $relations = array_merge($relations, $list);
                     break;
                 default:
                     // don't care
             }
         }
         if ($relations) {
             foreach ($relations as $relation) {
                 $this->add_relation($relation);
             }
         }
         $this->save();
     } else {
         return FALSE;
     }
 }
开发者ID:BGCX262,项目名称:zupal-svn-to-git,代码行数:57,代码来源:Artists.php


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