本文整理汇总了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());
}
示例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;
}
}