added UNIQUE property to MindProperty

Esse commit está contido em:
Felipe Nascimento de Moura
2011-02-24 21:30:20 -03:00
commit 77cc6e4631
7 arquivos alterados com 28 adições e 6 exclusões
+18
Ver Arquivo
@@ -16,6 +16,7 @@
public $refTo= false;
public $refBy= Array();
public $key= false;
public $unique= false;
/**
* Checks if the string sent indicates that it is about a property
@@ -54,6 +55,19 @@
$rx= "/".implode('|', Tokenizer::$qualifiers['notnull'])."/i";
return (preg_match($rx, $expression))? true: false;
}
/**
* Verifies on the passed string if it indicates that the current
* property definition should be unique or not
*
* @param String $expression
* @return boolean
*/
public static function isUnique($expression)
{
$rx= "/".implode('|', Tokenizer::$qualifiers['unique'])."/i";
return (preg_match($rx, $expression))? true: false;
}
/**
* Returns true in case the passed expression represent a property
@@ -146,6 +160,10 @@
}
$this->options= $options;
}
// checking if it is unique
if(self::isUnique($details))
$this->unique= true;
}
return true;
}
+1
Ver Arquivo
@@ -80,6 +80,7 @@ class Tokenizer extends Token{
self::$qualifiers['of'] = self::parseByComa($xml->of);
self::$qualifiers['be'] = self::parseByComa($xml->be);
self::$qualifiers['coma'] = self::parseByComa($xml->coma);
self::$qualifiers['unique'] = self::parseByComa($xml->unique);
return self::$qualifiers;
}
+2 -2
Ver Arquivo
@@ -15,7 +15,7 @@
<symbols>\/!@#$%*()_-+=,.'":>&amp;&lt;|{}[]</symbols>
</validchars>
<replacements>
<from></from>
<to ></to>
<from>-</from>
<to >_</to>
</replacements>
</root>
+1
Ver Arquivo
@@ -14,4 +14,5 @@
<be>is,are</be>
<key>key,pk,index</key>
<coma>and</coma>
<unique>unique,single,only,alone</unique>
</root>
+2 -2
Ver Arquivo
@@ -15,7 +15,7 @@
<symbols>\/!@#$%*()_-+=,.'":>&amp;&lt;|{}[]</symbols>
</validchars>
<replacements>
<from>áéíóúÁÉÍÓÚÀàÂâêÊîÎôÔûÛãÃõÕẽẼüÜçÇ</from>
<to >aeiouAEIOUAaAaeEiIoOuUaAoOeEuUcC</to>
<from>áéíóúÁÉÍÓÚÀàÂâêÊîÎôÔûÛãÃõÕẽẼüÜçÇ-</from>
<to >aeiouAEIOUAaAaeEiIoOuUaAoOeEuUcC_</to>
</replacements>
</root>
+1
Ver Arquivo
@@ -14,4 +14,5 @@
<be>é,são,será,serão</be>
<key>chave,key,pk,indice,índice</key>
<coma>e,quanto</coma>
<unique>unico,único,isolado,isolada,isoladamente</unique>
</root>
+3 -2
Ver Arquivo
@@ -1,4 +1,5 @@
cada professor deve ter um ou vários alunos.
comandante da tropa-militar tem armamentos.
/*cada professor deve ter um ou vários alunos.
sogra e sogro tem um genro e nora.
sogra, sogro, genro e nora tem nome:varchar(200, obrigatório), idade:int e
@@ -17,4 +18,4 @@ tanto mãe quanto pai tem nome:varchar, idade:int e sexo:char(1, {F=Feminino|M=M
professor também tem pai e mãe.
aluno pode ter divérsos irmãos.
Cada irmão pode ter filhos, e cada filho pode ter filho.
A grade de cadeiras terá várias disciplinas.
A grade de cadeiras terá várias disciplinas.*/