DataObject – where to keep the class files stored
- SamuelThorn
- Member | 29
Hello there,
I feel like a noob, but I have come by a thing called DataObject (e.g. Application, Course, Lecturer) and I have found it really useful. To this time I was passing data around application in Arrays, which was probably not the best way.
The question I would like to ask is, where in the application tree do you store these objects' classes (like physically store the files)? Those are neither Presenters, neither Services, those are just Data.
I have tried to look on the internet but probably I was asking the wrong question.
Can you please give me some advice, or point me to some source I can read about this?
- SamuelThorn
- Member | 29
Thank you.
I have tried and it has worked perfectly.
I am obviously still missing something very basic here. How does the
application know, where to look, when I use new dataObject()
. Does
Nette goes through all the folders looking for classes?
- CZechBoY
- Member | 3608
Basically this does php via autoloading (https://www.php.net/…autoload.php), you probably use combination of Nette RobotLoader and Composer autoloader.
- SamuelThorn
- Member | 29
Oh, I knew I have read about it somewhere in the past. Thank you. Funny (or maybe not so funny) thing that one (me) is building complex applications forgetting the very basics.
Live nad learn.
Thank you.