mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-22 18:18:46 +02:00
WIP
This commit is contained in:
@@ -109,6 +109,11 @@ abstract class AbstractFormBlock implements IFormBlock
|
||||
return $this->oParent;
|
||||
}
|
||||
|
||||
public function HasParent(): bool
|
||||
{
|
||||
return $this->oParent !== null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the form block name.
|
||||
*
|
||||
@@ -128,6 +133,19 @@ abstract class AbstractFormBlock implements IFormBlock
|
||||
return $sParentName.'_'.$this->sName;
|
||||
}
|
||||
|
||||
public function GetPath(): array
|
||||
{
|
||||
$aPath = [];
|
||||
$oCurrent = $this;
|
||||
|
||||
do {
|
||||
$aPath[] = $oCurrent->GetName();
|
||||
$oCurrent = $oCurrent->getParent();
|
||||
} while ($oCurrent->HasParent());
|
||||
|
||||
return array_reverse($aPath);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the form block options.
|
||||
* Options will be passed to FormType for building.
|
||||
|
||||
Reference in New Issue
Block a user