added feature of options on attributes

Esse commit está contido em:
Felipe Nascimento de Moura
2011-02-17 17:26:26 -02:00
commit 950b116188
6 arquivos alterados com 23 adições e 4 exclusões
+16
Ver Arquivo
@@ -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;
}
+2 -1
Ver Arquivo
@@ -3,7 +3,8 @@
* Will normalize the data and entities structure applying
* rules and patterns
*
*
* foreach entity
*
*
* @author felipe
*/
+1 -1
Ver Arquivo
@@ -12,7 +12,7 @@
<upper>ABCDEFGHIJKLMNOPQRSTUVXYZW</upper>
<special>."</special>
<numbers>1234567890</numbers>
<symbols>\/!@#$%*()_-+=,.'":>&amp;&lt;</symbols>
<symbols>\/!@#$%*()_-+=,.'":>&amp;&lt;|{}[]</symbols>
</validchars>
<replacements>
<from></from>
+1 -1
Ver Arquivo
@@ -12,7 +12,7 @@
<upper>ABCDEFGHIJKLMNOPQRSTUVXYZW</upper>
<special>áéíóúÁÉÍÓÚ"."ÀàÂâêÊîÎôÔûÛãÃõÕẽẼüÜçÇ</special>
<numbers>1234567890</numbers>
<symbols>\/!@#$%*()_-+=,.'":>&amp;&lt;</symbols>
<symbols>\/!@#$%*()_-+=,.'":>&amp;&lt;|{}[]</symbols>
</validchars>
<replacements>
<from>áéíóúÁÉÍÓÚÀàÂâêÊîÎôÔûÛãÃõÕẽẼüÜçÇ</from>
+2
Ver Arquivo
@@ -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/');
+1 -1
Ver Arquivo
@@ -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().