Pletacka website Nette documentation
Documentation for pletacka project
Public Member Functions | Public Attributes | List of all members
App\CoreModule\Model\DatabaseSelectionManager Class Reference

Manage work shifts. More...

Public Member Functions

 __construct (Context $database, ThisSensorManager $thisSensorManager, WorkShiftManager $workShiftManager)
 
 getCountSensors ($number)
 Get count of rows in table. More...
 
 sensorIsExist ($number)
 Is sensor exist? More...
 
 getDbSelectionName (int $sNumber, $selection)
 
 getLowerSelection (string $selection)
 
 createSelection (int $sNumber, string $selection, DateTime $from)
 Generate database selection. More...
 
 createSelectionFromTo (int $number, string $selection, DateTime $from, DateTime $to)
 
 createMultiSelection (int $number, DateTime $from, DateTime $to)
 
 createMultiSelectionForSensorsFromTo (object $sensors, DateTime $from, DateTime $to)
 
 createSelections (object $sensors, string $selection, DateTime $from)
 
 getSelectionData (int $number, string $selection, string $workShift, DateTime $from, DateTime $to)
 
 getSelectionDataDetail (int $number, string $selection, $workShift, DateTime $from, DateTime $to)
 

Public Attributes

const HOUR = "H"
 
const DAY = "D"
 
const MONTH = "M"
 
const YEAR = "Y"
 
const HOUR_L = "hour"
 
const DAY_L = "day"
 
const MONTH_L = "month"
 
const YEAR_L = "year"
 
const WsA = "Cahovi"
 
const WsB = "Vaňkovi"
 

Detailed Description

Manage work shifts.

Constructor & Destructor Documentation

◆ __construct()

App\CoreModule\Model\DatabaseSelectionManager::__construct ( Context  $database,
ThisSensorManager  $thisSensorManager,
WorkShiftManager  $workShiftManager 
)

Member Function Documentation

◆ createMultiSelection()

App\CoreModule\Model\DatabaseSelectionManager::createMultiSelection ( int  $number,
DateTime  $from,
DateTime  $to 
)

◆ createMultiSelectionForSensorsFromTo()

App\CoreModule\Model\DatabaseSelectionManager::createMultiSelectionForSensorsFromTo ( object  $sensors,
DateTime  $from,
DateTime  $to 
)

◆ createSelection()

App\CoreModule\Model\DatabaseSelectionManager::createSelection ( int  $sNumber,
string  $selection,
DateTime  $from 
)

Generate database selection.

Parameters
int$sNumberSensor number
string$selectionType of selection [self::H, D, M, Y]
DateTime$from
Returns
Pretty

◆ createSelectionFromTo()

App\CoreModule\Model\DatabaseSelectionManager::createSelectionFromTo ( int  $number,
string  $selection,
DateTime  $from,
DateTime  $to 
)
Parameters
int$number
string$selectionlong format (DAY_L);
DateTime$from
DateTime$to
Returns
Pretty

◆ createSelections()

App\CoreModule\Model\DatabaseSelectionManager::createSelections ( object  $sensors,
string  $selection,
DateTime  $from 
)

◆ getCountSensors()

App\CoreModule\Model\DatabaseSelectionManager::getCountSensors (   $number)

Get count of rows in table.

Parameters
$numbermachine number
Returns
int count of rows

◆ getDbSelectionName()

App\CoreModule\Model\DatabaseSelectionManager::getDbSelectionName ( int  $sNumber,
  $selection 
)

◆ getLowerSelection()

App\CoreModule\Model\DatabaseSelectionManager::getLowerSelection ( string  $selection)

◆ getSelectionData()

App\CoreModule\Model\DatabaseSelectionManager::getSelectionData ( int  $number,
string  $selection,
string  $workShift,
DateTime  $from,
DateTime  $to 
)
Parameters
int$number
string$selection[self::HOUR, DAY, MONTH, YEAR]
string$workShift["Cahovi" or "Vaňkovi"]
DateTime$from
DateTime$to
Returns
DatabaseDataExtractorPretty

◆ getSelectionDataDetail()

App\CoreModule\Model\DatabaseSelectionManager::getSelectionDataDetail ( int  $number,
string  $selection,
  $workShift,
DateTime  $from,
DateTime  $to 
)
Parameters
int$number
string$selection[self::HOUR, DAY, MONTH, YEAR]
$workShift["Cahovi" or "Vaňkovi" / null (all)]
DateTime$from
DateTime$to
Returns
array

◆ sensorIsExist()

App\CoreModule\Model\DatabaseSelectionManager::sensorIsExist (   $number)

Is sensor exist?

Parameters
$numbermachine number
Returns
bool

Member Data Documentation

◆ DAY

const App\CoreModule\Model\DatabaseSelectionManager::DAY = "D"

◆ DAY_L

const App\CoreModule\Model\DatabaseSelectionManager::DAY_L = "day"

◆ HOUR

const App\CoreModule\Model\DatabaseSelectionManager::HOUR = "H"

◆ HOUR_L

const App\CoreModule\Model\DatabaseSelectionManager::HOUR_L = "hour"

◆ MONTH

const App\CoreModule\Model\DatabaseSelectionManager::MONTH = "M"

◆ MONTH_L

const App\CoreModule\Model\DatabaseSelectionManager::MONTH_L = "month"

◆ WsA

const App\CoreModule\Model\DatabaseSelectionManager::WsA = "Cahovi"

◆ WsB

const App\CoreModule\Model\DatabaseSelectionManager::WsB = "Vaňkovi"

◆ YEAR

const App\CoreModule\Model\DatabaseSelectionManager::YEAR = "Y"

◆ YEAR_L

const App\CoreModule\Model\DatabaseSelectionManager::YEAR_L = "year"

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