- get_parent_class: documentation ( source)
- method_exists: documentation ( source)
<?php
class parentx
{
//public function bagr() { }
}
class childx extends parentx
{
public function bagr()
{
if (!method_exists(get_parent_class($this), __FUNCTION__))
{
throw new \LogicException;
}
// muj kód
}
}
$x = new childx();
$x->bagr();