public static function delete($gId) { $result = parent::delete($gId); if ($result['success']) { // update also locations $entityClass = static::getEntityClass('link'); $entityClass::deleteAllForOwner($gId); // we should also remove links when removing group (for other entities this is not always so) } return $result; }