protected function mapToType($key, $value) { $type = $this->getTypeFromKey($key); $outValue = $value; if (isset($type)) { $value = WebUtilities::getInstance()->convertToType($value, $type); } return $value; }
/** * On construction the url is parsed into pieces. */ function __construct() { $util = WebUtilities::getInstance(); $this->protocol = strpos(strtolower($util->getValue($_SERVER, ServerVariables::PROTOCOL)), Protocols::HTTPS) === FALSE ? Protocols::HTTP : Protocols::HTTPS; $this->hostName = $util->getValue($_SERVER, ServerVariables::HTTP_HOST); $this->pageName = $util->getValue($_SERVER, ServerVariables::SCRIPT_NAME); $this->queryString = $util->getValue($_SERVER, ServerVariables::QUERY_STRING); $this->url = $util->getValue($_SERVER, ServerVariables::REQUEST_URI); $this->requestMethod = $util->getValue($_SERVER, ServerVariables::REQUEST_METHOD); $this->referer = $util->getValue($_SERVER, ServerVariables::HTTP_REFERER); $this->webUtil = WebUtilities::getInstance(); }
private function validateCardCode($cardCode) { $util = WebUtilities::getInstance(); $error = null; if (!$util->hasValue($cardCode)) { $error = $util->getString("errorCreditCardCodeRequired"); } else { if (!preg_match("/^[0-9]{3,4}\$/", $cardCode)) { $error = $util->getString("errorCreditCardCodeInvalid"); } } return $error; }
/** * Controller constructor * * @param Kohva\Scotch\Routers\Router $router the router for the controller */ function __construct($router = null) { $this->util = WebUtilities::getInstance(); $this->router = $router; }
private function validateRoutingNumber($routingNumber) { $util = WebUtilities::getInstance(); $error = null; if (!$util->hasValue($routingNumber)) { $error = $util->getString("errorRoutingNumberRequired"); } else { if (!preg_match("/^[0-9]{9}\$/", $routingNumber)) { $error = $util->getString("errorRoutingNumberInvalid"); } } return $error; }
function __construct($properties = null) { $this->util = WebUtilities::getInstance(); }