EllisLab text mark
Advanced Search
problems with Zend Gdata objects in my model
Posted: 05 August 2008 10:54 PM
Joined: 2007-12-26
15 posts

Hi, I’m trying to add events to a google calendar and am running the code in model methods. I keep getting fatal errors like this:

Fatal errorCall to a member function newEventEntry() on a non-object in C:\wamp\www\delay-ad\system\application\models\scheduler_model.php 

I assume I just have object syntax incorrect. please help!

class Scheduler_model extends Model{
function Scheduler_model(){

$user 'em@ail.com';
$pass 'p@ssw0rD';
$service Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
$client Zend_Gdata_ClientLogin::getHttpClient($user,$pass,$service);
function addSubjectVisits($subID,$initials,$trial,$baselineDate){

foreach($visitTemplate as $v){
$blStamp $v['relativeToBL'];
$windowSeconds $v['windowdays']*24*60*60
$earlyStamp $targetStamp $windowSeconds;
$lateStamp $targetStamp $windowSeconds;

function createGoogleCalendarVisit($trial$visitName$targetStamp$earlyStamp$lateStamp){
$event->content$this->service->newContent($title "on August 12, 2008");
$event->quickAdd $this->service->newQuickAdd("true");

I got the Gdata code from here: Zend Manual

Posted: 07 August 2008 02:10 AM   [ # 1 ]   [ Rating: 0 ]
Joined: 2008-08-07
1 posts


It looks like you’re not creating the $this->service object.  After you create the $client in the constructor, you probably want something like this:

$this->service = new Zend_Gdata_Calendar($client); 

In addition to the Zend docs, you can see here for snippets of code:


Posted: 07 August 2008 06:26 PM   [ # 2 ]   [ Rating: 0 ]
Joined: 2007-12-26
15 posts

ah yes that was the problem. thank you!