public function replaceReservedMethod($methodName, $context = null)
{
if ($this->getReservedMethodsInstance()->is($methodName)) {
if ($context !== null) {
$methodKey = $methodName . '_' . $context;
if (!array_key_exists($methodKey, $this->replacedReservedMethods)) {
$this->replacedReservedMethods[$methodKey] = 0;
} else {
$this->replacedReservedMethods[$methodKey]++;
}
return '_' . $methodName . ($this->replacedReservedMethods[$methodKey] ? '_' . $this->replacedReservedMethods[$methodKey] : '');
} else {
return '_' . $methodName;
}
} else {
return $methodName;
}
}