Been scouring the internet looking for documentation that gives a list of acceptable strings for the function setOrderBy.
The youtube API page on google code has a link to a dead page at Zend Framework docs, and the docs that I was able to find here (I would give a direct link but can’t find any way to deep link to specific Zend docs – on the left expand Zend_Gdata -> youTube -> Zend_Gdata_YouTube_VideoQuery), provide no more detail than could be derived from the function name:
setOrderBy( string $value ) : \Zend_Gdata_YouTube_Query
Set the value of the orderby parameter
Parameters
Name Type Description
$value string
Returns
Type Description
\Zend_Gdata_YouTube_Query Provides a fluent interface
The function in the Zend library is defined as follows:
/**
* @param string $value
* @return Zend_Gdata_Gbase_ItemQuery Provides a fluent interface
*/
public function setOrderBy($value)
{
if ($value !== null) {
$this->_params['orderby'] = $value;
} else {
unset($this->_params['orderby']);
}
return $this;
}
So not much help there either… several google searches didn’t reveal anything. Is there any reference or documentation that maps specific strings to expected output?
**EDIT***
I found a newer version of the youtube php developer API docs. There is a section below that has more information for setOrderBy(). There is a list of 4 strings it will take, but if you provide the strings UPPER_CASE as shown in this documentation (eg: VIEW_COUNT) the query will not work. An example above the setOrderBy documentation calls the function using a camelCase string, and by brute force I was able to find these 4 working parameters:
'viewCount'
'relevance'
'updated'
'rating'
Using a google Search combining the actual parameters I found that worked (see edits above) with a few API related search terms, I found the resource that maps strings to expected results:
http://code.google.com/apis/youtube/2.0/reference.html#orderbysp
In short, the strings this function can take are:
For a video feed:
For a playlist feed: