O'Reilly logo

PHP 5 Social Networking by Michael Peacock

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Room for improvement

We have developed a powerful status stream in this chapter, but as with anything there is always room for improvement. Let's discuss how this might be improved and extended.

Firstly, there is some overlap in terms of logic and queries with the user's profile and the status' delegator within the profile. It may be possible for us to centralize this functionality and use it in both these instances, perhaps generating a stream for a profile or generating a stream for a network, depending on methods called in the object.

Secondly, we are doing a few small queries in the controller. This is generally best avoided, and instead models should be used to generate the comments, likes, and dislikes. We could create models for these, which ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required