mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
N°3123 - Create specific block for DisplayBlock(type: List)
This commit is contained in:
60
sources/application/UI/tBlockParams.php
Normal file
60
sources/application/UI/tBlockParams.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (C) 2010-2020 Combodo SARL
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
namespace Combodo\iTop\Application\UI;
|
||||
|
||||
/**
|
||||
* Trait tBlockParams
|
||||
*
|
||||
* Add generic parameters to blocks
|
||||
*
|
||||
* @package Combodo\iTop\Application\UI
|
||||
*/
|
||||
trait tBlockParams
|
||||
{
|
||||
/** @var array */
|
||||
protected $aParameters;
|
||||
|
||||
/**
|
||||
* @param string $sName
|
||||
*
|
||||
* @return mixed|null
|
||||
*/
|
||||
public function GetParameter(string $sName)
|
||||
{
|
||||
if (isset($this->aParameters[$sName])) {
|
||||
return $this->aParameters[$sName];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sName
|
||||
* @param $value
|
||||
*/
|
||||
public function AddParameter(string $sName, $value)
|
||||
{
|
||||
$this->aParameters[$sName] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function GetParameters(): array
|
||||
{
|
||||
return $this->aParameters;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $aParameters
|
||||
*/
|
||||
public function SetParameters(array $aParameters): void
|
||||
{
|
||||
$this->aParameters = $aParameters;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user