Link Element - Google Base Products

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
phppage
Forum Contributor
Posts: 126
Joined: Mon Apr 24, 2006 1:47 pm
Location: West Yorkshire, UK

Link Element - Google Base Products

Post by phppage »

I am trying to pipe in some products from a MySQL DB to Google Base via Google API. I am using the Zend Framework and the documentation from section 15.7.3 here http://framework.zend.com/manual/en/zen ... gbase.html All is well and the basics work however I really want to insert link back to the products page on a website. I have tried using the addGbaseAttribute fuction but the link does not work correctly and just lists it as an attribute rather than a link from the listed item its self. I think the reason is the namespace needs to be different looking at this documentation http://base.google.com/base/api/univers ... cale=en_US you can see that the link element is listed as a universal element along with title. I have tried $newEntry->link but with no success. I was wondering if anyone has any experience in this and could give me some pointers or a solution on how to insert the link element correctly. Have spent hours searching on Google with no luck :(

Cheers
User avatar
phppage
Forum Contributor
Posts: 126
Joined: Mon Apr 24, 2006 1:47 pm
Location: West Yorkshire, UK

Post by phppage »

Have the solution if anyone is wondering.

Code: Select all

$linkArray = $entry->link; 
$linkArray[] = $gdClient->newLink( 
    'http://www.example.com/123456jsh9', 
    'alternate', 'text/html'); 
$entry->link = $linkArray;

Thanks to Jeff S of Google Base Data API Google group for the answer.
Post Reply