FreenetIS
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Time_Activity_Rule Class Reference

This class is used as predecesor of models that can be sheduled on sime time and then runned by CRON. More...

Inheritance diagram for Time_Activity_Rule:
ORM Bank_accounts_automatical_download_Model Messages_automatical_activation_Model

Public Member Functions

 get_type ()
 Gets type of rule.
 get_attribute ($index=0)
 Gets first attribute of rule.
 get_attributes ()
 Gets all attributes of rule.

Static Public Member Functions

static get_type_messages ($translate=TRUE)
 Gets set of self cancel messages.
static get_type_message ($type, $translate=TRUE)
 Gets message for the given type.
static get_type_attributes ($aa_type)
 Gets attributes of the given automatical activation type.
static get_type_attributes_count ($aa_type)
 Gets attributes count of the given automatical activation type.
static get_attribute_types ($translate=TRUE)
 Gets attribute types.
static get_attribute_types_max_count ()
 Gets maximal count of attributes of all types of rule.
static filter_rules ($rules, $apply_minute, $time)
 Check all of obtain rules if they may be activated in the given time and returns all that may be.

Public Attributes

const TYPE_MONTHLY = 1
 auto activation each month, attibutes:
const TYPE_WEEKLY = 2
 auto activation each week, attributes:
const TYPE_DAILY = 3
 auto activation each day, attributes:
const TYPE_DAILY_WD = 4
 auto activation each working day, attributes:
const TYPE_HOURLY = 5
 auto activation each hour, empty attributes.
const TYPE_AFTER_DEDUCTION = 6
 auto activation in the deduction day in the specified hour, attributes:

Detailed Description

This class is used as predecesor of models that can be sheduled on sime time and then runned by CRON.

For example notification may triggered daily/hourly/monthly/etc.

All model classes that implements this class must define columns for type (integer) and attribute (mixed - varchar(255)).

Author
Ondrej Fibich

Member Function Documentation

static Time_Activity_Rule::filter_rules (   $rules,
  $apply_minute,
  $time 
)
static

Check all of obtain rules if they may be activated in the given time and returns all that may be.

Parameters
array[TimeActivityRule]$rules Activity rules
string$apply_minuteMinute of activation as string in format /[0-9]{2}/
long$timeTime obtain from time() function
Returns
array[TimeActivityRule] Passed rules
Time_Activity_Rule::get_attribute (   $index = 0)

Gets first attribute of rule.

Parameters
integer$indexIndex of attribute from 0 [optional - first as default]
Returns
mixed Value of attribute or NULL if not valid index
static Time_Activity_Rule::get_attribute_types (   $translate = TRUE)
static

Gets attribute types.

Parameters
boolean$translate
Returns
array
static Time_Activity_Rule::get_attribute_types_max_count ( )
static

Gets maximal count of attributes of all types of rule.

Returns
integer
Time_Activity_Rule::get_attributes ( )
abstract

Gets all attributes of rule.

Returns
array

Reimplemented in Messages_automatical_activation_Model, and Bank_accounts_automatical_download_Model.

Time_Activity_Rule::get_type ( )
abstract

Gets type of rule.

Returns
integer

Reimplemented in Messages_automatical_activation_Model, and Bank_accounts_automatical_download_Model.

static Time_Activity_Rule::get_type_attributes (   $aa_type)
static

Gets attributes of the given automatical activation type.

Parameters
integer$aa_typeAutomatical activation type
Returns
null|array
static Time_Activity_Rule::get_type_attributes_count (   $aa_type)
static

Gets attributes count of the given automatical activation type.

Parameters
integer$aa_typeAutomatical activation type
Returns
integer
static Time_Activity_Rule::get_type_message (   $type,
  $translate = TRUE 
)
static

Gets message for the given type.

Parameters
integer$type
boolean$translate
Returns
string|null
static Time_Activity_Rule::get_type_messages (   $translate = TRUE)
static

Gets set of self cancel messages.

Author
Ondřej Fibich
Parameters
bool$translateTranslate messages
Returns
array

Member Data Documentation

const Time_Activity_Rule::TYPE_AFTER_DEDUCTION = 6

auto activation in the deduction day in the specified hour, attributes:

  • hour (hour of activation with value from 0..23)
const Time_Activity_Rule::TYPE_DAILY = 3

auto activation each day, attributes:

  • hour (hour of activation with value from 0..23)
const Time_Activity_Rule::TYPE_DAILY_WD = 4

auto activation each working day, attributes:

  • hour (hour of activation with value from 0..23)
const Time_Activity_Rule::TYPE_MONTHLY = 1

auto activation each month, attibutes:

  • day (day of activation with value 1..31, if the current month has less days than setted attribute - e.g. 27.2. - notification is activated on last of this date)
  • hour (hour of activation with value from 0..23)
const Time_Activity_Rule::TYPE_WEEKLY = 2

auto activation each week, attributes:

  • day (day of activation with value 1..7)
  • hour (hour of activation with value from 0..23)

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