PHP access data of an object

后端 未结 4 2066
野性不改
野性不改 2021-01-20 14:51

I have an object of which I am looking to get a piece of data from, the object looks like this,

    Product Object
(
    [name] => Simon Test Cup
    [co         


        
4条回答
  •  無奈伤痛
    2021-01-20 15:14

    Assuming Felix' answer doesn't work (which it may very well), I'm guessing that the _related field is protected. In that case, there should be an accessor method in that class to let you get related objects. Please use get_class_methods() on the object and edit your post with the methods that are available.

提交回复
热议问题