Blesta
  • Package
  • Class
  • Tree
  • Deprecated

Packages

  • blesta
    • app
      • components
        • events
          • default
      • controllers
      • models
    • components
      • auth
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • exchange
        • rates
          • foxrate
          • google
            • finance
          • yahoo
            • finance
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
      • json
      • modules
      • net
        • http
        • net
          • amazon
            • s3
          • geo
            • ip
      • plugins
      • recaptcha
      • security
      • session
        • cart
      • settingscollection
      • upgrades
      • upload
      • vcard
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
  • com
    • tecnick
      • tcpdf
        • blesta
          • components
            • invoice
              • templates
                • quickbooks
                  • invoice
                • templates
                  • default
  • Crypt
    • AES
    • DES
    • Hash
    • Random
    • RC4
    • Rijndael
    • RSA
    • TerraDES
  • File
    • ANSI
    • ASN1
    • X509
  • Math
    • BigInteger
  • minPHP
    • components
      • input
      • record
    • helpers
      • color
      • data
        • structure
      • date
      • html
      • xml
    • lib
  • Net
    • SFTP
    • SSH1
    • SSH2
  • None
  • PHP
  • PHPMailer
  • Services
    • JSON
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • Accounts
  • ApiKeys
  • Backup
  • CalendarEvents
  • ClientGroups
  • Clients
  • Companies
  • Contacts
  • Countries
  • Coupons
  • CronTasks
  • Currencies
  • EmailGroups
  • Emails
  • Encryption
  • GatewayManager
  • Invoices
  • InvoiceTemplateManager
  • Languages
  • Logs
  • Marketplace
  • ModuleManager
  • Navigation
  • PackageGroups
  • Packages
  • Payments
  • Permissions
  • PluginManager
  • 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()
private Record
# getEvents( )

Returns a Record objects consisting of a partial query on calendar events

Returns a Record objects consisting of a partial query on calendar events

Returns

Record
A partial query on calendar events
private array
# getRules( array $vars, boolean $edit = false )

Retrieves a list of add/edit rules

Retrieves a list of add/edit rules

Parameters

$vars
array
$vars A list of input vars
$edit
boolean
$edit True to retrieve the edit rules, false to retrieve the add rules (optional, default false)

Returns

array
A list of input rules
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