Access array in PHP object -


I have the following PHP object but I'm struggling to get array items from objects.

<[item: protected] = & gt; [Item: protected] = & gt; [Raw: protected] = & gt; [title: protected] = & gt; [description: protected] = & gt; [link: protected] = & gt; Data / example [feed_nid: protected] = & gt; Array ([0] = & gt; array ([path] => data / example / example / [file name] => CSV) [1] => array ([path] = & gt; Data / example / example / [file name] => file.csv) [2] = & gt; array ([path] => dexampleata / example / 0 [total: protected] => array [[Progress: protected] / [filename] => file.csv] [current_item: protected] => [created] => 0 [update] => = & gt; Aare ([ Fetching] => 1 [parsing] => 1 [processing] => 1))

I need to reach the three key arrays and post it some Pro Data Esing.

What is the best way to go about grabbing the array?

If you can edit the square, write public or a gator for it:

  function getItems () {return $ this-> item; }  

Otherwise, if you can not edit the class yourself, then you can increase it because the properties you want are protected, which means that the hair class can reach them. Is:

  class YourClass reaches that classic {public function getItems {// parent $ item actually $ - this-> Return items; }}  

Then you will need to create an example of yourClass of that class and get items from it.

Similarly for any other protected property.


Comments