[eluser]flokky[/eluser]
I'm trying to use the Zend Gdata framework to access YouTube. This is working great. The only thing I'm having problem with, is how I can change or alter the structure of the data being returned by the YouTube service.
I have a piece of code that searches for all videos uploaded by the given user:
Code:
function getAllUserUploads($userName) {
$yt = new Zend_Gdata_YouTube();
return printVideoFeed($yt->getuserUploads($userName));
}
I iterate over all found videos and call 'printVideoEntry' for printing out the video-properties :
Code:
function printVideoFeed($videoFeed) {
foreach ($videoFeed as $videoEntry) {
printVideoEntry($videoEntry);
}
return $videoFeed;
}
What I would like to do: I would like to adjust the $videoEntry->getVideoId() and append HTML to that property, so I can easily print out a YouTube player....
Code:
function printVideoEntry($videoEntry) {
...
$videoEntry->getVideoId() = createEmbedTagCode($videoEntry->getVideoId())
...
}
... but this results in an error:
Code:
Fatal error: Can't use method return value in write context ...
How can I use the setter of the $videoEntry object so I can alter videoId?