CMS  Version 3.9
Event Class Reference

Defines the Event class. More...

Inherits DataItem.

Public Member Functions

 Sites ($constraint="")
 
 Calendar ()
 
 Owner ()
 
 Comments ($constraint="")
 
 setOwner ()
 
 isOwner ()
 
 Invitation ()
 
 TimeZone ()
 
 Event ()
 

Public Attributes

 $fields
 
 $relations
 

Detailed Description

Defines the Event class.

Definition at line 42 of file event.inc.

Member Function Documentation

◆ Calendar()

Event::Calendar ( )

Definition at line 76 of file event.inc.

77  {
78  return $this->getRelated(Calendar);
79  }
Defines the Event class.
Definition: calendar.inc:43

◆ Comments()

Event::Comments (   $constraint = "")

Definition at line 87 of file event.inc.

88  {
89  return $this->crossReference(Comment, EventCommentXref, $constraint);
90  }
$constraint

◆ Event()

Event::Event ( )

Definition at line 124 of file event.inc.

125  {
126  $this->table = "event";
127  $this->primary_key = "event_id";
128 
129  $this->DataItem(func_get_args());
130  }

◆ Invitation()

Event::Invitation ( )

Definition at line 110 of file event.inc.

111  {
112  if(!$this->event_invitation_id) return null;
113 
114  return $this->getRelated(EventInvitation);
115  }

◆ isOwner()

Event::isOwner ( )

Definition at line 100 of file event.inc.

101  {
102  global $user;
103  if(!$user) return false;
104 
105  $pk = $user->getPrimaryKey();
106 
107  return (checkRole("admin") || $user->$pk == $this->owner_id) ? true : false;
108  }
global $user
$table column("Redirect From", "<a href='redirect_form?redirect_id={redirect_id}'>{redirect_from}</a>", true, "width: 30%") -> column("Redirect To", "<a href='{redirect_to}' target='_blank'>{redirect_to}</a>", true, "width: 30%") ->column("Last Modified", "{last_modified}", true, "width: 20%; text-align: center") ->column("Override", "{ override true
Definition: redirects.inc:9

◆ Owner()

Event::Owner ( )

Definition at line 81 of file event.inc.

82  {
83  $mgr = new UserManager();
84  return $mgr->getUser($this->owner_id);
85  }
$calendar owner_id
Provides the interface to the user model for the application.

◆ setOwner()

Event::setOwner ( )

Definition at line 92 of file event.inc.

93  {
94  global $user;
95 
96  $pk = $user->getPrimaryKey();
97  $this->owner_id = $user->$pk;
98  }

◆ Sites()

Event::Sites (   $constraint = "")

Definition at line 71 of file event.inc.

72  {
73  return $this->crossReference(Site, EventSiteXref, $constraint);
74  }
Definition: site.inc:40

◆ TimeZone()

Event::TimeZone ( )

Definition at line 117 of file event.inc.

118  {
119  if(!$this->time_zone_id) return null;
120 
121  return $this->getRelated(TimeZone);
122  }

Member Data Documentation

◆ $fields

Event::$fields
Initial value:
= array("event_id" => Number,
"title" => String,
"calendar_id" => Number,
"start_date" => DateTime,
"end_date" => DateTime,
"time_zone_id" => Number,
"location" => String,
"event_type" => String,
"description" => HTML,
"published" => Boolean,
"allow_access" => String,
"owner_id" => Number,
"last_modified" => Timestamp,
"event_invitation_id" => Number,
"composite_class" => String,)

Definition at line 44 of file event.inc.

◆ $relations

Event::$relations
Initial value:
= array(
"Sites" => Site,
"Calendar" => Calendar,
"Invitation" => EventInvitation,
"TimeZone" => TimeZone,
"Comments" => Comment,
"Owner" => "",
)

Definition at line 62 of file event.inc.


The documentation for this class was generated from the following file: