Designing OOP classes (php) - lynch
Good day!
I would like to move on in the study of php, and in my head there are a lot of classes I need for development.
I created a repository for myself, and I use most of the classes in all my projects, but the feeling that
I am making mistakes in designing classes does not leave me.
I have no mentors who would use OOP and class repositories, therefore I ask the habrasociety to disengage two small classes that I use everywhere.
The first class is events {} http://www.pastebin.ru/304393 (Output messages to the user or save to the database for administration). The mysqlLayer class is also required for use (for working with the database) The
second class is images{} http://www.pastebin.ru/304394 (Resizing images). To use the events class is required.
I would like to know what mistakes in designing and using the OOP approach in your opinion I have made, and in general what recommendations you can give.
UPD: (what are the conclusions of the discussion at the moment for myself)
1 - Instead of error codes in digital form, use words (instead of 1 - notFile)
2 - Use the generally accepted name of the getInstance method and not load in the Singletone
3 pattern - Use enum classes instead string values in class
I would like to move on in the study of php, and in my head there are a lot of classes I need for development.
I created a repository for myself, and I use most of the classes in all my projects, but the feeling that
I am making mistakes in designing classes does not leave me.
I have no mentors who would use OOP and class repositories, therefore I ask the habrasociety to disengage two small classes that I use everywhere.
The first class is events {} http://www.pastebin.ru/304393 (Output messages to the user or save to the database for administration). The mysqlLayer class is also required for use (for working with the database) The
second class is images{} http://www.pastebin.ru/304394 (Resizing images). To use the events class is required.
I would like to know what mistakes in designing and using the OOP approach in your opinion I have made, and in general what recommendations you can give.
UPD: (what are the conclusions of the discussion at the moment for myself)
1 - Instead of error codes in digital form, use words (instead of 1 - notFile)
2 - Use the generally accepted name of the getInstance method and not load in the Singletone
3 pattern - Use enum classes instead string values in class