Jump to content

Class Scope


stuart475898

Recommended Posts

I have a program (procedural) that when started, instantiates a couple of different classes (class A and class B). My question is, is it possible to access class A from class B, or do I have to instantiate class A again in class B?

 

Thanks for any help

 

Sorry this topic is in the wrong area, I thought I had navigated back from the regex forum when I started the topic

Link to comment
https://forums.phpfreaks.com/topic/160159-class-scope/
Share on other sites

Thank you for your reply.

 

I am working on a program that uses the betfair api. I have a main class which handles all of the requests sent to betfair and does some basic error handling, and this class is started from the main program. I also have a number of other classes which perform functions on market information, but sometimes these other classes need to send a request to betfair (via the main class).

 

                  MAIN PROGRAM
                       /  \
                      /    \
                     /      \
           Main Class       Market Processing Class

 

The main program starts all classes, and then sends a request to betfair for market details via the main class. This data is then passed to the market processing class. However, the market processing class might need to send a request to betfair, and needs to use the main class.

Link to comment
https://forums.phpfreaks.com/topic/160159-class-scope/#findComment-845010
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.