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; }
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; } }