PHP Classes

File: docs/Package.md

Recommend this page to a friend!
  Classes of Kjell-Inge Gustafsson   Gectrl PHP Generic Controller Class   docs/Package.md   Download  
File: docs/Package.md
Role: Auxiliary data
Content type: text/markdown
Description: Auxiliary data
Class: Gectrl PHP Generic Controller Class
Controller class that delegates in action classes
Author: By
Last change:
Date: 3 years ago
Size: 4,563 bytes
 

Contents

Class file image Download

[comment]: # (This file is part of Gectrl, PHP Genereric controller. Copyright 2021 Kjell-Inge Gustafsson, kigkonsult, All rights reserved, licence LGPLv3)

Class Package

A transaction data information encapsulated package class with

  • unique timestamp and guid (default set at instance creation)
  • opt config and logger(s)
  • any kind of (_scalar_ / _array_ / _object_) __input__ and actionClasses __output__
  • intermediate (tmp/work) data
  • result status log

The Package class instance argument is always passed as reference when the [Gectrl] class instance are * invoking the [ActionClassInterface] methods * return exec result

Package is internally using [KeyValueMgr] for workData and resultLog (below) and is to recommend as config.

Class common methods

__construct( [ config [, logger [, input ]]] )
  • Package constructor
  • 
    
  • 
    
init( [ config [, logger [, input ]]] )
  • 
    
  • 
    
  • Return Package class instance
  • _static_

Properties && methods

timestamp

  • valueType : _float_
  • Current Unix timestamp with microseconds, default 'microtime( true)' at instance create
getTimestamp()
  • Return _float_
setTimestamp( timestamp )
  • Set (replace) timestamp
  • 
    
  • Return _static_

___

correlationId

  • valueType : _string_
  • Unique guid, default set at instance create
getCorrelationId()
  • Return string
setCorrelationId( correlationId )
  • Set (replace) correlationId (guid)
  • 
    
  • Return _static_

___

config * valueType : _mixed_ * Opt any config

getConfig()
  • Return _mixed_ (object passed as reference)
isConfigSet()
  • Return _bool_, true if config is set, otherwise false
setConfig( config )
  • 
    
  • Return _static_

___

logger * valueType : _mixed_ * Opt any logger

getLogger()
  • Return _mixed_ (object passed as reference)
isLoggerSet()
  • Return _bool_, true if logger is set, otherwise false
setLogger( logger )
  • 
    
  • Return _static_

___

input * valueType : _mixed_ (_scalar_ / _array_ / _object_), required

getInput()
  • Return _mixed_ (_scalar_ / _array_ / _object_ passed as reference)
isInputSet()
  • Return _bool_, true if input is set, otherwise false
setInput( input )
  • 
    
  • Return _static_

___

output * valueType : _mixed_ (_scalar_ / _array_ / _object_)

getOutput()
  • Return _mixed_ (_scalar_ / _array_ / _object_ passed as reference)
isOutputSet()
  • Return _bool_, true if output is set, otherwise false
setOutput( output )
  • 
    
  • Return _static_

___

workData * valueType : _[KeyValueMgr]_ * Opt work data, shared between actionClasses,<br> ex. single-load multi-use work resource(s)

getWorkData( [ key ] )
  • 
    
  • Return _[KeyValueMgr]_|_mixed_|_bool_, false if key not found
  • Major KeyValueMgr methods (passed as reference) * KeyValueMgr::exists( key ) : _bool_ * KeyValueMgr::get( key ) : _mixed_ * KeyValueMgr::set( key, value ) : _[KeyValueMgr]_
getWorkDataKeys()
  • Return _string[]_ workData keys
isWorkDataKeySet( key )
  • 
    
  • Return _bool_, true if workData key is set, otherwise false
setWorkData( key, value )
  • 
    
  • Return _static_

___

resultLog * valueType : _[KeyValueMgr]_ * Opt (any) actionClass effect outcome

getResultLog( [ key ] )
  • 
    
  • Return _[KeyValueMgr]_|_mixed_|_bool_, false if key not found
  • Major KeyValueMgr methods (passed as reference) * KeyValueMgr::exists( key ) : _bool_ * KeyValueMgr::get( key ) : _mixed_ * KeyValueMgr::set( key, value ) : _[KeyValueMgr]_
getResultLogKeys()
  • Return _string[]_ resultLog keys
isResultLogKeySet( key )
  • 
    
  • Return _bool_, true if resultLog key is set, otherwise false
setResultLog( key, value )
  • 
    
  • Return _static_

Go to [README], [ActionClassInterface], [Gectrl] docs.

[ActionClassInterface]:ActionClassInterface.md [Gectrl]:Gectrl.md [KeyValueMgr]:https://github.com/iCalcreator/KeyValueMgr [README]:../README.md