php - Call to a member function getDOM() on a non-object -
I'm trying to create a PHP function that adds an event to Google Calendar. It seems that the object is being created correctly but this error is a brief category when attempting to add an event to a member function getDOM () on non-object in feedpartyperient.fpp, which is only the constructor And the function that adds an event:
class GCal_datasource {private $ user = 'xxxxxxx'; Private $ pass = 'xxxxxxxxx'; Private $ customer; Private $ gdata_cal; Private $ calendar; Private $ visibility; Public function __ composition ($ settings = NULL) {session_start (); Need_once 'Zend / Loader.php'; Zend_Loader :: loadClass ('Zend_Gdata'); Zend_Loader :: loadClass ('Zend_Gdata_ClientLogin'); Zend_Loader :: loadClass ('Zend_Gdata_HttpClient'); Zend_Loader :: loadClass ('Zend_Gdata_Calendar'); If ($ settings == tap) {$ settings = array (); $ Settings ['calendar'] = 'default'; $ Settings ['visibility'] = 'complete'; } $ This- & gt; Calendar = $ settings ['calendar']; $ This- & gt; Visibility = $ setting ['visibility']; $ This- & gt; Client = $ this- & gt; Get_ClientLoginHttpClient (); $ This- & gt; Gdata_cal = New Zend_Gdata_Calendar ($ this-> Client); } Public function create_event ($ field) {$ gc = $ this- & gt; Gdata_cal; $ New_event = $ this- & gt; Gdata_cal-> New Event Entry (); Echo '& lt; Pre & gt; '; Print_r ($ sectors); Echo & lt; / Pre & gt; '; If (isset ($ fields ['quick_add'])) {$ new_event-> Content = $ gc- & gt; New Containant ($ field ['quick_add']); $ New_event- & gt; QuickAdd = $ gc- & gt; New Quickick (true); } Else if (isset ($ fields ['title']) & isset ($ fields ['if'])) {$ new_event-> Title = $ fields ['title']; $ Where = $ gc- & gt; New (where $ field ['ou']); $ New_event- & gt; Where = array ($ where); $ Desc = $ gc- & gt; New containant ($ field ['desc']); $ New_event- & gt; Content = $ desc; $ New_event- & gt; Content-> Type = 'text'; $ New_event- & gt; When = self :: build_when_array ($ field ['when']); If (isset ($ fields ['web_content'])) {$ new_event-> Link = web_event_array ($ fields ['web_content']); }} Echo '& lt; Pre & gt; '; Print_r ($ new_event); Echo & lt; / Pre & gt; '; $ Gc- & gt; InsertEvent ($ new_event); Back $ made_evolution-> id- & gt; Text; }}
Error (I believe) I'm calling insertEvent () towards the end of the code. The only reason I feel that it only gets an error when it is in existence and if I remove it then the echo of it is printed in the form of an object.
Whichever eye-catching PHP API I have a better understanding of who can lend me one hand, I highly appreciate it.
I had this problem, I think you have to change the string
$ New_event-> Title = $ fields ['title'];
to
$ new_event-> Title = $ service-> New title ($ field ['title']);
Comments
Post a Comment