{"id":6771,"date":"2014-04-23T04:00:38","date_gmt":"2014-04-23T04:00:38","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/23\/php-fatal-error-call-to-a-member-function-getuser-on-a-non-object-collection-of-common-programming-errors\/"},"modified":"2014-04-23T04:00:38","modified_gmt":"2014-04-23T04:00:38","slug":"php-fatal-error-call-to-a-member-function-getuser-on-a-non-object-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/23\/php-fatal-error-call-to-a-member-function-getuser-on-a-non-object-collection-of-common-programming-errors\/","title":{"rendered":"PHP Fatal error: Call to a member function getUser() on a non-object-Collection of common programming errors"},"content":{"rendered":"<p>I am new to OOP and trying to recall a function from a parent class in Facebook WP plugin, I get the error from the file of the parent class<\/p>\n<p>my code is:<\/p>\n<pre><code>class check_fb extends Wdfb_Model {\nfunction __construct() {\n            Wdfb_Model::get_wp_user_from_fb();\n    }\n}\n\n\/\/REST OF THE CODE\n<\/code><\/pre>\n<p>here is the code for the class http:\/\/codepad.org\/d7MtD9i7 knowing that it is a class within a WP facebook plugin and works well within that plugin<\/p>\n<p>generally what I am trying to do is define the property <code>$this-&gt;fb-&gt;api('\/me');<\/code> in the my class to get the user FB information, since I can&#8217;t declare the class FACEBOOK which is already declared from the plugin.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am new to OOP and trying to recall a function from a parent class in Facebook WP plugin, I get the error from the file of the parent class my code is: class check_fb extends Wdfb_Model { function __construct() { Wdfb_Model::get_wp_user_from_fb(); } } \/\/REST OF THE CODE here is the code for the class [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6771","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6771","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6771"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6771\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6771"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6771"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6771"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}