get('validation.level'); if ($mode != 'disabled') { //If the mode is disabled, bypass the validation foreach (array('set' . $attributeName, 'get' . $attributeName) as $methodName) { if (get_class($class) == get_class(new PayPalModel())) { // Silently return false on cases where you are using PayPalModel instance directly return false; } //Check if both getter and setter exists for given attribute elseif (!method_exists($class, $methodName)) { //Delegate the error based on the choice $className = is_object($class) ? get_class($class) : (string)$class; $errorMessage = "Missing Accessor: $className:$methodName. Please let us know by creating an issue at https://github.com/paypal/PayPal-PHP-SDK/issues"; PayPalLoggingManager::getInstance(__CLASS__)->warning($errorMessage); if ($mode == 'strict') { trigger_error($errorMessage, E_USER_NOTICE); } return false; } } } return true; } }