2
votes
0answers
66 views

How to build child classes as parent configuration?

I'm using Codeigniter PHP Framework for developing a web application, and when developing an admin zone, I've ended building a generic parent class called AdminController which is extended by the ...
0
votes
2answers
270 views

In PHP, should I delete objects immediately after use?

I've read in PHP Advanced and Object Oriented Programming by Larry Ullman that it is good programming practice to delete object immediately after use but reason is given nowhere. I am a student web ...
0
votes
1answer
340 views

Basic OOP theory: misunderstanding surrounding database and user classes

New to OOP and trying to understand some basic fundamentals. Currently using PHP5 to build a basic web app. In using PHP's built in PDO as my database class and a separately created user class that ...
2
votes
2answers
352 views

Should I put utility methods inside a class?

I have been working on a library which contains a large set of functions. For the sake of simplicity, I am going to use just one set as an example. I am not sure which is the better way, in terms of ...
3
votes
2answers
639 views

application logic, business logic, models, controllers - where to put the application's brains?

I'm trying to wrap my head around models, views, and controllers, but I feel as though the more I read, the more conflicting information I seem to encounter. I guess the general goal is--as far as ...
0
votes
1answer
278 views

PHP function types

I am trying to find a way of classifying different types of PHP functions. For example that fopen, fwrite, fclose and so on are all part of IO, and the MySQL functions and MySQLi class is all for ...
1
vote
1answer
197 views

Is there a good design pattern for this messaging class?

Is there a good design pattern for this? I want to create a messaging class. The class will be passed: the type of message (eg. signup, signup confirmation, password reminder etc) the client's id ...
2
votes
2answers
123 views

Would be semantically correct to make a “Login” constructor in an api class?

Since the methods of the class will only work if the user is logged in, is it right or is there some problem that might make my code slow/inneficient?
4
votes
3answers
1k views

Is this the correct approach to an OOP design structure in php?

I'm converting a procedural based site to an OOP design to allow more easily manageable code in the future and so far have created the following structure: /classes /templates index.php With these ...