mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-19 00:28:47 +02:00
Add UIBlocks to twig (Add... methods can be called by specifying their name in the parameters)
This commit is contained in:
@@ -107,11 +107,13 @@ class UIBlockNode extends Node
|
||||
$oRefClass = new ReflectionClass($this->sBlockClass);
|
||||
$aMethods = $oRefClass->getMethods(ReflectionMethod::IS_PUBLIC);
|
||||
foreach ($aMethods as $oMethod) {
|
||||
if (!$oMethod->isStatic() && utils::StartsWith($oMethod->getName(), 'Set')) {
|
||||
$aSetters[] = substr($oMethod->getName(), 3); // remove 'Set' to get the variable name
|
||||
}
|
||||
if (!$oMethod->isStatic() && utils::StartsWith($oMethod->getName(), 'Add')) {
|
||||
$aAdders[] = $oMethod->getName();
|
||||
if (!$oMethod->isStatic() && $oMethod->getNumberOfParameters() == 1) {
|
||||
if (utils::StartsWith($oMethod->getName(), 'Set')) {
|
||||
$aSetters[] = substr($oMethod->getName(), 3); // remove 'Set' to get the variable name
|
||||
}
|
||||
if (utils::StartsWith($oMethod->getName(), 'Add')) {
|
||||
$aAdders[] = $oMethod->getName();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($aSetters)) {
|
||||
|
||||
Reference in New Issue
Block a user