51 lines
1.3 KiB
PHP
51 lines
1.3 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Subclass for representing a row from the 'st_task_scheduler_import_data' table.
|
|
*
|
|
*
|
|
*
|
|
* @package plugins.stTaskSchedulerImportPlugin.lib.model
|
|
*/
|
|
class stTaskSchedulerImportPreloadedData extends BasestTaskSchedulerImportPreloadedData
|
|
{
|
|
public function setTaskSchedulerImport(stTaskSchedulerImportBaseAbstract $import)
|
|
{
|
|
$hashId = null !== $import->getConfiguration()->getParent() ? $import->getConfiguration()->getParent()->getHashId() : $import->getConfiguration()->getHashId();
|
|
$this->setImportHashId($hashId);
|
|
}
|
|
|
|
/**
|
|
* Ustawia parametr
|
|
*
|
|
* @param string $name Nazwa parametru
|
|
* @param mixed $value Wartość parametru
|
|
* @return void
|
|
*/
|
|
public function setParameter(string $name, $value): void
|
|
{
|
|
$data = $this->getData();
|
|
|
|
if (null === $data)
|
|
{
|
|
$data = [];
|
|
}
|
|
|
|
$data[$name] = $value;
|
|
|
|
$this->setData($data);
|
|
}
|
|
|
|
/**
|
|
* Zwraca wartość parametru
|
|
*
|
|
* @param string $name Nazwa parametru
|
|
* @param mixed|null $default Domyślna wartość w przypadku braku
|
|
* @return mixed|null
|
|
*/
|
|
public function getParameter(string $name, $default = null)
|
|
{
|
|
return null !== $this->data && isset($this->data[$name]) ? $this->data[$name] : $default;
|
|
}
|
|
}
|