mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
N°2414 Remove \DBObject::RegisterCallback
This was experimental and never used. The official way is to use iApplicationObjectExtension !
This commit is contained in:
@@ -2759,15 +2759,6 @@ abstract class DBObject implements iDisplay
|
||||
$oTrigger->DoActivate($this->ToArgs('this'));
|
||||
}
|
||||
|
||||
// Callbacks registered with RegisterCallback
|
||||
if (isset($this->m_aCallbacks[self::CALLBACK_AFTERINSERT]))
|
||||
{
|
||||
foreach ($this->m_aCallbacks[self::CALLBACK_AFTERINSERT] as $aCallBackData)
|
||||
{
|
||||
call_user_func_array($aCallBackData['callback'], $aCallBackData['params']);
|
||||
}
|
||||
}
|
||||
|
||||
$this->RecordObjCreation();
|
||||
|
||||
return $this->m_iKey;
|
||||
@@ -4626,33 +4617,6 @@ abstract class DBObject implements iDisplay
|
||||
$oPage->details($aValues);
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
const CALLBACK_AFTERINSERT = 0;
|
||||
|
||||
/**
|
||||
* Register a call back that will be called when some internal event happens
|
||||
*
|
||||
* @internal
|
||||
*
|
||||
* @param $iType string Any of the CALLBACK_x constants
|
||||
* @param $callback callable Call specification like a function name, or array('<class>', '<method>') or array($object, '<method>')
|
||||
* @param $aParameters array Values that will be passed to the callback, after $this
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function RegisterCallback($iType, $callback, $aParameters = array())
|
||||
{
|
||||
$sCallBackName = '';
|
||||
if (!is_callable($callback, false, $sCallBackName))
|
||||
{
|
||||
throw new Exception('Registering an unknown/protected function or wrong syntax for the call spec: '.$sCallBackName);
|
||||
}
|
||||
$this->m_aCallbacks[$iType][] = array(
|
||||
'callback' => $callback,
|
||||
'params' => $aParameters
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Computes a text-like fingerprint identifying the content of the object
|
||||
* but excluding the specified columns
|
||||
|
||||
Reference in New Issue
Block a user