Update message class

access public
package kocuj_internal_lib
inherited_from \KocujIL\V12a\Classes\ComponentObject

 Methods

Constructor

__construct(object $projectObj) : void
Inherited
access public

Parameters

$projectObj

object

\KocujIL\V12a\Classes\Project object for current project

Action for preparing update message

actionAdminInit() : void
access public

Action for displaying update message

actionPrintFooterScripts() : void
access public

Add message for update from the selected version

addUpdateMessage(string $fromVersion, string $message, integer $useTopMessage = \KocujIL\V12a\Enums\Project\Components\Backend\UpdateMessage\UseTopMessage::NO) : void
access public

Parameters

$fromVersion

string

Version from which update will show message; it can be only fragment of version number, but then it must be ended with dot character ("."), for example, "1.", "1.0.", etc.

$message

string

Message to display

$useTopMessage

integer

Use top message with link to message to display or just show message; must be one of the following constants from \KocujIL\V12a\Enums\Project\Components\Backend\UpdateMessage\UseTopMessage: NO (when display just show message) or YES (when display top message with link to message to display) - default: \KocujIL\V12a\Enums\Project\Components\Backend\UpdateMessage\UseTopMessage::NO

Check if message for update from the selected version exists

checkMessage(string $fromVersion) : boolean
access public

Parameters

$fromVersion

string

Version from which update will show message

Returns

booleanMessage for update from the selected version exists (true) or not (false)

Check top message for update from the selected version

checkTopMessage(string $fromVersion) : boolean
access public

Parameters

$fromVersion

string

Version from which update will show message

Returns

booleanTop message for the selected version exists (true) or not (false)

Get object of class type from component

getComponent(string $type, integer $projectCategory = \KocujIL\V12a\Enums\ProjectCategory::CORE, string $fragment = '') : object
Inherited
access public

Parameters

$type

string

Component type

$projectCategory

integer

Component category; must be one of the following constants from \KocujIL\V12a\Enums\ProjectCategory: CORE (for "core" category), ALL (for "all" category), FRONTEND (for "frontend" category) or BACKEND (for "backend" category) - default: \KocujIL\V12a\Enums\ProjectCategory::CORE

$fragment

string

Component fragment - default: empty

Returns

objectObject of class type from component

Get version for last update message from database

getLastUpdateMessageVersionOptionValue() : string
access public

Returns

stringVersion for last update message from database

Get message for update from the selected version

getMessage(string $fromVersion) : boolean | string
access public

Parameters

$fromVersion

string

Version from which update will show message

Returns

booleanstringMessage for the selected version or false if not exists

Get messages for update data

getMessagesForUpdate() : array
access public

Returns

arrayMessages for update data; each message for update data has the following fields: "message" (string type; update message), "usetopmessage" (int type; if set to \KocujIL\V12a\Enums\Project\Components\Backend\UpdateMessage\UseTopMessage::YES, top message will be displayed with link to update message)

Get option name for version for last update message

getOptionNameLastUpdateMessageVersion() : string
Static
access public

Returns

stringOption name for version for last update message

Get object of type \KocujIL\V12a\Classes\Project

getProjectObj() : object
Inherited
access public

Returns

objectObject of type \KocujIL\V12a\Classes\Project

Get object of class type for strings from component

getStrings(string $type, integer $projectCategory = \KocujIL\V12a\Enums\ProjectCategory::CORE) : object
Inherited
access public

Parameters

$type

string

Component type

$projectCategory

integer

Component category; must be one of the following constants from \KocujIL\V12a\Enums\ProjectCategory: CORE (for "core" category), ALL (for "all" category), FRONTEND (for "frontend" category) or BACKEND (for "backend" category) - default: \KocujIL\V12a\Enums\ProjectCategory::CORE

Returns

objectObject of class type for strings from component

Remove message for update

removeMessageForUpdate(string $fromVersion) : void
access public

Parameters

$fromVersion

string

Version from which update will show message

Set dividing string for multiple message for one version update

setDivideString(string $divideString) : void
access public

Parameters

$divideString

string

Dividing string

Get message or top message for update from the selected version

getMessageOrTopMessage(boolean $isMessage, string $fromVersion) : boolean | integer | string
access private

Parameters

$isMessage

boolean

Message will be returned (true) or top message (false)

$fromVersion

string

Version from which update will show message

Returns

booleanintegerstringMessage text or check top message for the selected version or false if not exists

 Properties

 

Dividing string for multiple messages for one version update

$divideString : string

Default

'



'
access private
 

Message will be displayed (true) or not (false)

$messageDisplay : boolean

Default

array()
access private
 

\KocujIL\V12a\Classes\Project object for current project

$projectObj : object

Default

NULL
access private
 

Top message will be displayed (true) or not (false)

$topMessageDisplay : boolean

Default

array()
access private
 

Update messages

$updateMessage : array

Default

array()
access private