added feature of options on attributes
Esse commit está contido em:
@@ -10,6 +10,7 @@
|
||||
public $name= false;
|
||||
public $type= "text";
|
||||
public $size= 0;
|
||||
public $options= Array();
|
||||
public $default= null;
|
||||
public $required= false;
|
||||
public $refTo= false;
|
||||
@@ -130,6 +131,21 @@
|
||||
// identifying its size
|
||||
if(preg_match(PROP_SIZE, $details, $size))
|
||||
$this->size= $size[0];
|
||||
|
||||
// identifying the options
|
||||
if(preg_match(PROP_OPTIONS, $details, $options))
|
||||
{
|
||||
$options= explode('|',
|
||||
preg_replace(PROP_OPTIONS_CLEAR,
|
||||
'',
|
||||
$options[0])
|
||||
);
|
||||
foreach($options as &$opt)
|
||||
{
|
||||
$opt= explode('=', $opt, 2);
|
||||
}
|
||||
$this->options= $options;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
* Will normalize the data and entities structure applying
|
||||
* rules and patterns
|
||||
*
|
||||
*
|
||||
* foreach entity
|
||||
*
|
||||
*
|
||||
* @author felipe
|
||||
*/
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<upper>ABCDEFGHIJKLMNOPQRSTUVXYZW</upper>
|
||||
<special>."</special>
|
||||
<numbers>1234567890</numbers>
|
||||
<symbols>\/!@#$%*()_-+=,.'":>&<</symbols>
|
||||
<symbols>\/!@#$%*()_-+=,.'":>&<|{}[]</symbols>
|
||||
</validchars>
|
||||
<replacements>
|
||||
<from></from>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<upper>ABCDEFGHIJKLMNOPQRSTUVXYZW</upper>
|
||||
<special>áéíóúÁÉÍÓÚ"."ÀàÂâêÊîÎôÔûÛãÃõÕẽẼüÜçÇ</special>
|
||||
<numbers>1234567890</numbers>
|
||||
<symbols>\/!@#$%*()_-+=,.'":>&<</symbols>
|
||||
<symbols>\/!@#$%*()_-+=,.'":>&<|{}[]</symbols>
|
||||
</validchars>
|
||||
<replacements>
|
||||
<from>áéíóúÁÉÍÓÚÀàÂâêÊîÎôÔûÛãÃõÕẽẼüÜçÇ</from>
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
// REGULAR EXPRESSIONS
|
||||
define('PROP_DETAILS', "/\(.*/");
|
||||
define('PROP_DEFAULT', "/\".*\"/");
|
||||
define('PROP_OPTIONS', '/\{(.+?)\}/');
|
||||
define('PROP_OPTIONS_CLEAR', '/^\{|\}$/');
|
||||
define('PROP_DEFEXEC', "/(^(\"=)|(\"exec\:))|(\"$)/i");
|
||||
define('PROP_SIZE', "/\d+(\.?\d+)/");
|
||||
define('COMA_SEPARATOR', '/\s/');
|
||||
|
||||
@@ -16,5 +16,5 @@ aluno tem pai, mãe.
|
||||
aluno tem tio, tia.
|
||||
aluno tem nome:caractere(128, obrigatório, não nulo, "josé's da conceição")
|
||||
pai tem \pilha.
|
||||
mãe tem nome:varchar, idade:int e sexo:char().
|
||||
mãe tem nome:varchar, idade:int e sexo:char(1, {F=Feminino|M=Masculino}).
|
||||
pai tem nome:varchar, idade:int e sexo:char().
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário