Blesta
  • Package
  • Class
  • Tree
  • Deprecated

Packages

  • blesta
    • app
      • controllers
      • models
    • components
      • areyouahuman
      • auth
        • motp
        • oath
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • events
        • default
      • exchange
        • rates
          • google
            • finance
          • yahoo
            • finance
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
          • quickbooks
            • invoice
      • json
      • modules
      • net
        • amazon
          • s3
        • http
        • net
          • geo
            • ip
      • plugins
      • recaptcha
      • reports
        • aging
          • invoices
        • custom
          • report
        • invoice
          • creation
        • tax
          • liability
        • transactions
          • applied
          • received
      • security
      • session
        • cart
      • settingscollection
      • upgrades
        • tasks
      • upload
      • vcard
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
      • widget
        • client
  • minPHP
    • components
      • input
      • record
    • helpers
      • color
      • data
        • structure
      • date
      • form
      • html
      • javascript
      • xml
    • lib
  • None
  • PHP

Classes

  • Accounts
  • ApiKeys
  • CalendarEvents
  • ClientGroups
  • Clients
  • Companies
  • Contacts
  • Countries
  • Coupons
  • CronTasks
  • Currencies
  • EmailGroups
  • Emails
  • Encryption
  • GatewayManager
  • Invoices
  • InvoiceTemplateManager
  • Languages
  • Logs
  • Marketplace
  • ModuleClientMeta
  • ModuleManager
  • Navigation
  • PackageGroups
  • PackageOptionGroups
  • PackageOptions
  • Packages
  • Payments
  • Permissions
  • PluginManager
  • Pricings
  • ReportManager
  • ServiceChanges
  • Services
  • Settings
  • Staff
  • StaffGroups
  • States
  • Taxes
  • Themes
  • Transactions
  • Users

Class CalendarEvents

CalendarEvents

Model
Extended by AppModel
Extended by CalendarEvents
Package: blesta\app\models
Copyright: Copyright (c) 2010, Phillips Data, Inc.
License: The Blesta License Agreement
Link: Blesta
Located at app/models/calendar_events.php

Methods summary

public
# __construct( )

Initialize the CalendarEvents

Initialize the CalendarEvents

Overrides

AppModel::__construct
public integer
# add( array $vars )

Adds a calendar event

Adds a calendar event

Parameters

$vars
array
$vars An array of calendar event data including: -company_id The ID of the company to add this event under -staff_id The ID of the staff member that created this event -shared Whether or not this event is shared among other staff members of this company (true to share false otherwise, default false) -title The title of the event -url The URL to link this event to (optional, default null) -start_date The start date of the event -end_date The end date of the event -all_day Whether or not this event spans the entire day of the start/end dates (default false)

Returns

integer
The ID of the calendar event created, void on error
public
# edit( integer $calendar_event_id, array $vars )

Updates a calendar event

Updates a calendar event

Parameters

$calendar_event_id
integer
$calendar_event_id The ID of the calendar event to update
$vars
array
$vars An array of calendar event data including (only parameters submitted will be updated): -company_id The ID of the company to add this event under -staff_id The ID of the staff member that created this event (required) -shared Whether or not this event is shared among other staff members of this company (true to share false otherwise) -title The title of the event -url The URL to link this event to -start_date The start date of the event -end_date The end date of the event -all_day Whether or not this event spans the entire day of the start/end dates
public
# delete( integer $calendar_event_id )

Deletes a calendar event

Deletes a calendar event

Parameters

$calendar_event_id
integer
$calendar_event_id The ID of the calendar event to delete
public mixed
# get( integer $calendar_event_id )

Fetches a calendar event

Fetches a calendar event

Parameters

$calendar_event_id
integer
$calendar_event_id The ID of the calendar event to fetch

Returns

mixed
A stdClass object representing the calendar event, false if no such event exists
public array
# getAll( integer $company_id, integer $staff_id, string $start_date, string $end_date, boolean $include_shared = true )

Fetches all of events that begin between the given start and end dates

Fetches all of events that begin between the given start and end dates

Parameters

$company_id
integer
$company_id The ID of the company to fetch for
$staff_id
integer
$staff_id The ID of the staff member to fetch for
$start_date
string
$start_date Defines the lower bound for event start dates
$end_date
string
$end_date Defines the upper bound for event start dates
$include_shared
boolean
$include_shared If true will include shared calendar events, false will only include events for this staff member

Returns

array
An array of stdClass objects, each representing a calendar event

See

CalendarEvents::getRange()
public array
# getRange( integer $company_id, integer $staff_id, string $start_date, string $end_date, boolean $include_shared = true )

Fetches a set of events that begin or end between the given start and end dates (e.g. exist between the given start and end dates).

Fetches a set of events that begin or end between the given start and end dates (e.g. exist between the given start and end dates).

Parameters

$company_id
integer
$company_id The ID of the company to fetch for
$staff_id
integer
$staff_id The ID of the staff member to fetch for
$start_date
string
$start_date Defines the lower bound for event start/end dates
$end_date
string
$end_date Defines the upper bound for event start/end dates
$include_shared
boolean
$include_shared If true will include shared calendar events, false will only include events for this staff member

Returns

array
An array of stdClass objects, each representing a calendar event

See

CalendarEvents::getAll()
public boolean
# validateStaffEvent( integer $staff_id, integer $event_id )

Validates whether the given event belongs to the given staff member

Validates whether the given event belongs to the given staff member

Parameters

$staff_id
integer
$staff_id The ID of the staff member that created this event
$event_id
integer
$event_id The ID of the calendar event created

Returns

boolean
True if the calendar event belongs to the given staff member, false otherwise
public
# validateDateOrder( string $start_date, string $end_date )

Validates that the given start date is before the given end date, inclusive

Validates that the given start date is before the given end date, inclusive

Parameters

$start_date
string
$start_date The start date
$end_date
string
$end_date The end date

Methods inherited from AppModel

_(), boolToInt(), currencyToDecimal(), dateToUtc(), errors(), getPerPage(), ifSet(), loadCrypto(), setDefaultIfEmpty(), setPerPage(), setRulesIfSet(), strToBool(), systemDecrypt(), systemEncrypt(), systemHash(), truncateDecimal(), validateExists(), validateStateCountry()

Methods inherited from Model

affectedRows(), begin(), commit(), getConnection(), lastInsertId(), makeDSN(), prepare(), query(), rollBack(), setAttribute(), setFetchMode()

Magic methods summary

Properties summary

Properties inherited from AppModel

$replacement_keys

Blesta API documentation generated by ApiGen 2.8.0