added UNIQUE property to MindProperty
Esse commit está contido em:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<symbols>\/!@#$%*()_-+=,.'":>&<|{}[]</symbols>
|
||||
</validchars>
|
||||
<replacements>
|
||||
<from></from>
|
||||
<to ></to>
|
||||
<from>-</from>
|
||||
<to >_</to>
|
||||
</replacements>
|
||||
</root>
|
||||
|
||||
@@ -14,4 +14,5 @@
|
||||
<be>is,are</be>
|
||||
<key>key,pk,index</key>
|
||||
<coma>and</coma>
|
||||
<unique>unique,single,only,alone</unique>
|
||||
</root>
|
||||
@@ -15,7 +15,7 @@
|
||||
<symbols>\/!@#$%*()_-+=,.'":>&<|{}[]</symbols>
|
||||
</validchars>
|
||||
<replacements>
|
||||
<from>áéíóúÁÉÍÓÚÀàÂâêÊîÎôÔûÛãÃõÕẽẼüÜçÇ</from>
|
||||
<to >aeiouAEIOUAaAaeEiIoOuUaAoOeEuUcC</to>
|
||||
<from>áéíóúÁÉÍÓÚÀàÂâêÊîÎôÔûÛãÃõÕẽẼüÜçÇ-</from>
|
||||
<to >aeiouAEIOUAaAaeEiIoOuUaAoOeEuUcC_</to>
|
||||
</replacements>
|
||||
</root>
|
||||
|
||||
@@ -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>
|
||||
@@ -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.*/
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário