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

Events

With calendar functionality and birthday lookups in place, adding event functionality should be straightforward. Let's take a look at what we will need:

  • An event model
    • To generate data from an event
    • To create and edit an event
  • Integration with our calendar controller
  • An event controller to display the event details, manage the creation of the event, and manage attendees and RSVPs

Event model

As with all of our models, the first stage is to define the variables, which relate to the registry, the fields for the event in the database, and an array of invitees to the event:

<?php /** * Event model */ class Event{ /** * The registry */ private $registry; /** * Event ID */ private $ID; /** * Creators ID */ private $creator; /** * Event name */ private ...

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