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

Images

To process images as a new status type, we will need a new database table and a new model to extend from the main status model. We will also need some new views, and to change the profile and status stream controllers (though we will make those changes after adding the three new status types).

Database table

The database table for images simply needs two fields:

Field

Type

Description

ID

Integer, Primary key

To relate to the main statuses table

Image

Varchar

The image filename

These two fields will be connected to the statuses table via a left join, to bring in the image filename for statuses that are images.

Model

The model needs to extend our statuses model, providing setters for any new fields, call the parent constructor, call ...

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