phpdoc/Validator/StringMaskValidator.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="robots" content="index, follow, all" />
<title>Validator\StringMaskValidator | Validators</title>
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../css/bootstrap-theme.min.css">
<link rel="stylesheet" type="text/css" href="../css/sami.css">
<script src="../js/jquery-1.11.1.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/typeahead.min.js"></script>
<script src="../sami.js"></script>
<meta name="MobileOptimized" content="width">
<meta name="HandheldFriendly" content="true">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
</head>
<body id="class" data-name="class:Validator_StringMaskValidator" data-root-path="../">
<div id="content">
<div id="left-column">
<div id="control-panel">
<form id="search-form" action="../search.html" method="GET">
<span class="glyphicon glyphicon-search"></span>
<input name="search"
class="typeahead form-control"
type="search"
placeholder="Search">
</form>
</div>
<div id="api-tree"></div>
</div>
<div id="right-column">
<nav id="site-nav" class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-elements">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../index.html">Validators</a>
</div>
<div class="collapse navbar-collapse" id="navbar-elements">
<ul class="nav navbar-nav">
<li><a href="../classes.html">Classes</a></li>
<li><a href="../namespaces.html">Namespaces</a></li>
<li><a href="../interfaces.html">Interfaces</a></li>
<li><a href="../traits.html">Traits</a></li>
<li><a href="../doc-index.html">Index</a></li>
<li><a href="../search.html">Search</a></li>
</ul>
</div>
</div>
</nav>
<div class="namespace-breadcrumbs">
<ol class="breadcrumb">
<li><span class="label label-default">class</span></li>
<li><a href="../Validator.html">Validator</a></li>
<li>StringMaskValidator</li>
</ol>
</div>
<div id="page-content">
<div class="page-header">
<h1>StringMaskValidator</h1>
</div>
<p> class
<strong>StringMaskValidator</strong> implements
<a href="../Validator/ValidatorInterface.html"><abbr title="Validator\ValidatorInterface">ValidatorInterface</abbr></a>
</p>
<div class="description">
<p>String mask validator</p> </div>
<h2>Methods</h2>
<div class="container-fluid underlined">
<div class="row">
<div class="col-md-2 type">
</div>
<div class="col-md-8 type">
<a href="#method___construct">__construct</a>(
string $mask = null,
string $ref = null,
array $options = array())
<p>Constructor</p> </div>
<div class="col-md-2"></div>
</div>
<div class="row">
<div class="col-md-2 type">
object
</div>
<div class="col-md-8 type">
<a href="#method_setMask">setMask</a>(
string $mask,
bool $protect = null)
<p>Set the mask to test for values
The mask can be escaped by the 'preg_quote' function setting the second argument on TRUE.</p> </div>
<div class="col-md-2"></div>
</div>
<div class="row">
<div class="col-md-2 type">
object
</div>
<div class="col-md-8 type">
<a href="#method_setMaskReference">setMaskReference</a>(
string $ref)
<p>Set the mask reference</p> </div>
<div class="col-md-2"></div>
</div>
<div class="row">
<div class="col-md-2 type">
object
</div>
<div class="col-md-8 type">
<a href="#method_setPcreOptions">setPcreOptions</a>(
string $opts)
<p>Set the PCRE options</p> </div>
<div class="col-md-2"></div>
</div>
<div class="row">
<div class="col-md-2 type">
object
</div>
<div class="col-md-8 type">
<a href="#method_setPcreDelimiter">setPcreDelimiter</a>(
string $delim)
<p>Set the PCRE delimiter</p> </div>
<div class="col-md-2"></div>
</div>
<div class="row">
<div class="col-md-2 type">
object
</div>
<div class="col-md-8 type">
<a href="#method_setPregQuote">setPregQuote</a>(
bool $protect)
<p>Set the protection on mask</p> </div>
<div class="col-md-2"></div>
</div>
<div class="row">
<div class="col-md-2 type">
bool
</div>
<div class="col-md-8 type">
<a href="#method_validate">validate</a>(
string $value,
bool $send_errors = false)
<p>Process validation</p> </div>
<div class="col-md-2"></div>
</div>
<div class="row">
<div class="col-md-2 type">
mixed
</div>
<div class="col-md-8 type">
<a href="#method_sanitize">sanitize</a>(
mixed $value)
<p>Try to make $value pass the validation</p> </div>
<div class="col-md-2"></div>
</div>
</div>
<h2>Details</h2>
<div id="method-details">
<div class="method-item">
<h3 id="method___construct">
<div class="location">at line 66</div>
<code>
<strong>__construct</strong>(
string $mask = null,
string $ref = null,
array $options = array())</code>
</h3>
<div class="details">
<div class="method-description">
<p>Constructor</p> </div>
<div class="tags">
<h4>Parameters</h4>
<table class="table table-condensed">
<tr>
<td>
string</td>
<td>$mask</td>
<td>The mask to test</td>
</tr>
<tr>
<td>
string</td>
<td>$ref</td>
<td>The mask reference</td>
</tr>
<tr>
<td>
array</td>
<td>$options</td>
<td>A set of options to set the object properties</td>
</tr>
</table>
</div>
</div>
</div>
<div class="method-item">
<h3 id="method_setMask">
<div class="location">at line 100</div>
<code>
object
<strong>setMask</strong>(
string $mask,
bool $protect = null)</code>
</h3>
<div class="details">
<div class="method-description">
<p>Set the mask to test for values
The mask can be escaped by the 'preg_quote' function setting the second argument on TRUE.</p> </div>
<div class="tags">
<h4>Parameters</h4>
<table class="table table-condensed">
<tr>
<td>
string</td>
<td>$mask</td>
<td>The mask to test in PCRE</td>
</tr>
<tr>
<td>
bool</td>
<td>$protect</td>
<td>Do we have to protect the mask ?</td>
</tr>
</table>
<h4>Return Value</h4>
<table class="table table-condensed">
<tr>
<td>
object</td>
<td>$this for method chaining</td>
</tr>
</table>
</div>
</div>
</div>
<div class="method-item">
<h3 id="method_setMaskReference">
<div class="location">at line 115</div>
<code>
object
<strong>setMaskReference</strong>(
string $ref)</code>
</h3>
<div class="details">
<div class="method-description">
<p>Set the mask reference</p> </div>
<div class="tags">
<h4>Parameters</h4>
<table class="table table-condensed">
<tr>
<td>
string</td>
<td>$ref</td>
<td>The reference of the validation mask</td>
</tr>
</table>
<h4>Return Value</h4>
<table class="table table-condensed">
<tr>
<td>
object</td>
<td>$this for method chaining</td>
</tr>
</table>
</div>
</div>
</div>
<div class="method-item">
<h3 id="method_setPcreOptions">
<div class="location">at line 127</div>
<code>
object
<strong>setPcreOptions</strong>(
string $opts)</code>
</h3>
<div class="details">
<div class="method-description">
<p>Set the PCRE options</p> </div>
<div class="tags">
<h4>Parameters</h4>
<table class="table table-condensed">
<tr>
<td>
string</td>
<td>$opts</td>
<td>The options used for the PCRE mask construction</td>
</tr>
</table>
<h4>Return Value</h4>
<table class="table table-condensed">
<tr>
<td>
object</td>
<td>$this for method chaining</td>
</tr>
</table>
</div>
</div>
</div>
<div class="method-item">
<h3 id="method_setPcreDelimiter">
<div class="location">at line 139</div>
<code>
object
<strong>setPcreDelimiter</strong>(
string $delim)</code>
</h3>
<div class="details">
<div class="method-description">
<p>Set the PCRE delimiter</p> </div>
<div class="tags">
<h4>Parameters</h4>
<table class="table table-condensed">
<tr>
<td>
string</td>
<td>$delim</td>
<td>The delimiter used for PCRE mask construction</td>
</tr>
</table>
<h4>Return Value</h4>
<table class="table table-condensed">
<tr>
<td>
object</td>
<td>$this for method chaining</td>
</tr>
</table>
</div>
</div>
</div>
<div class="method-item">
<h3 id="method_setPregQuote">
<div class="location">at line 151</div>
<code>
object
<strong>setPregQuote</strong>(
bool $protect)</code>
</h3>
<div class="details">
<div class="method-description">
<p>Set the protection on mask</p> </div>
<div class="tags">
<h4>Parameters</h4>
<table class="table table-condensed">
<tr>
<td>
bool</td>
<td>$protect</td>
<td>The protection value to use 'preg_quote' protection on mask</td>
</tr>
</table>
<h4>Return Value</h4>
<table class="table table-condensed">
<tr>
<td>
object</td>
<td>$this for method chaining</td>
</tr>
</table>
</div>
</div>
</div>
<div class="method-item">
<h3 id="method_validate">
<div class="location">at line 165</div>
<code>
bool
<strong>validate</strong>(
string $value,
bool $send_errors = false)</code>
</h3>
<div class="details">
<div class="method-description">
<p>Process validation</p> </div>
<div class="tags">
<h4>Parameters</h4>
<table class="table table-condensed">
<tr>
<td>
string</td>
<td>$value</td>
<td>The value to validate</td>
</tr>
<tr>
<td>
bool</td>
<td>$send_errors</td>
<td>Does the function must throw exceptions on validation failures ?</td>
</tr>
</table>
<h4>Return Value</h4>
<table class="table table-condensed">
<tr>
<td>
bool</td>
<td>TRUE if <code>$value</code> passes the validation</td>
</tr>
</table>
<h4>Exceptions</h4>
<table class="table table-condensed">
<tr>
<td><a target="_blank" href="http://php.net/Exception"><abbr title="Exception">Exception</abbr></a></td>
<td>for each invalid part if <code>$send_errors</code> is true</td>
</tr>
</table>
</div>
</div>
</div>
<div class="method-item">
<h3 id="method_sanitize">
<div class="location">at line 196</div>
<code>
mixed
<strong>sanitize</strong>(
mixed $value)</code>
</h3>
<div class="details">
<div class="method-description">
<p>Try to make $value pass the validation</p> </div>
<div class="tags">
<h4>Parameters</h4>
<table class="table table-condensed">
<tr>
<td>
mixed</td>
<td>$value</td>
<td>
</td>
</tr>
</table>
<h4>Return Value</h4>
<table class="table table-condensed">
<tr>
<td>
mixed</td>
<td>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<div id="footer">
Generated by <a href="http://sami.sensiolabs.org/">Sami, the API Documentation Generator</a>.
</div>
</div>
</div>
</body>
</html>