Hi Max
This follows on from your reply here regarding this use of $this->data.
I have successfully read data from two tables. {debug:} shows that the data is in $this. The processing is a bit complex so I now want to access that data in an external PHP function.
I have set up a function
That throws an error
So the questions are -
[list=]How can I get around that error and access my data?[/list]
or
[list=]How can I just pass my data to that function?[/list]
If I modify my function to be
and the called function to be
then the data I get from the dump is
No data from the db read. That data is there - if I dump all of $this in the first example - I can see it - just can't work out how to get to it!
Hope this is clear..😲😲
This follows on from your reply here regarding this use of $this->data.
I have successfully read data from two tables. {debug:} shows that the data is in $this. The processing is a bit complex so I now want to access that data in an external PHP function.
I have set up a function
$blnSuccess=MandP_function($this);
and the php function called is simplyfunction MandP_function($this) {
var_dump($this->data);
return TRUE;
}
.
That throws an error
0 - Using $this when not in object context
which is, I believe, a PHP error, the fix for which Is beyond my current knowledge.So the questions are -
[list=]How can I get around that error and access my data?[/list]
or
[list=]How can I just pass my data to that function?[/list]
If I modify my function to be
$blnSuccess=MandP_function($this->data);
and the called function to be
function MandP_function($this) {
var_dump($this);
return TRUE;
}
then the data I get from the dump is
array(7) { ["conn"]=> string(20) "ManageMemberPartners" ["user_id"]=> string(4) "1493" ["function"]=> string(4) "SWAP" ["event"]=> string(4) "view" ["Itemid"]=> string(3) "610" ["option"]=> string(23) "com_chronoconnectivity6" ["view"]=> string(10) "connection" }
No data from the db read. That data is there - if I dump all of $this in the first example - I can see it - just can't work out how to get to it!
Hope this is clear..😲😲
Hi Nick,
Just pass the read data results to your function, you can get it with this line:
Best regards,
Max
Just pass the read data results to your function, you can get it with this line:
$this->get("read_data_function_name");
Best regards,
Max
This topic is locked and no more replies can be posted.