コード例 #1
0
 public function setKeyValidator(array $typeDefs)
 {
     if (empty($typeDefs)) {
         return;
     }
     foreach ($typeDefs as $typeDef) {
         if (!PandraValidator::exists($typeDef)) {
             throw new RuntimeException("{$typeDef} is not a Validator type");
         }
     }
     $this->_typeDefKey = $typeDefs;
 }
コード例 #2
0
ファイル: Column.class.php プロジェクト: jlaprise/Pandra
 public function setTypeDef($typeDefs, $onKey = FALSE)
 {
     if (empty($typeDefs)) {
         return;
     }
     if (!is_array($typeDefs)) {
         $typeDefs = (array) $typeDefs;
     }
     foreach ($typeDefs as $typeDef) {
         if (!PandraValidator::exists($typeDef)) {
             throw new RuntimeException("{$typeDef} is not a Validator type");
         }
     }
     if ($onKey) {
         $this->_typeDefKey = $typeDefs;
     } else {
         $this->_typeDef = $typeDefs;
     }
 }