本文整理汇总了PHP中Zend_Filter_Input::hasInvalid方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Filter_Input::hasInvalid方法的具体用法?PHP Zend_Filter_Input::hasInvalid怎么用?PHP Zend_Filter_Input::hasInvalid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Filter_Input
的用法示例。
在下文中一共展示了Zend_Filter_Input::hasInvalid方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _prepareSave
/**
* Preapares data for saving of subscriber
* Add the line for rapidmail status
*
* @param Mage_Newsletter_Model_Subscriber $subscriber
* @return array
*/
protected function _prepareSave(Mage_Newsletter_Model_Subscriber $subscriber)
{
$data = array();
$data['customer_id'] = $subscriber->getCustomerId();
$data['store_id'] = $subscriber->getStoreId() ? $subscriber->getStoreId() : 0;
$data['subscriber_status'] = $subscriber->getStatus();
$data['subscriber_email'] = $subscriber->getEmail();
$data['subscriber_confirm_code'] = $subscriber->getCode();
$data['rapidmail_status'] = $subscriber->getRapidmailStatus();
if ($subscriber->getIsStatusChanged()) {
$data['change_status_at'] = Mage::getSingleton('core/date')->gmtDate();
}
$validators = array('subscriber_email' => 'EmailAddress');
$filters = array();
$input = new Zend_Filter_Input($filters, $validators, $data);
$session = Mage::getSingleton($this->_messagesScope);
if ($input->hasInvalid() || $input->hasMissing()) {
foreach ($input->getMessages() as $message) {
if (is_array($message)) {
foreach ($message as $error) {
$session->addError($error);
}
} else {
$session->addError($message);
}
}
Mage::throwException(Mage::helper('newsletter')->__('Form was filled incorrectly'));
}
return $data;
}
示例2: _filterInputIdentify
protected function _filterInputIdentify($parameters)
{
$input = new Zend_Filter_Input(array('*' => 'StripTags', 'username' => 'StringTrim'), array('username' => array(), 'password' => array(), 'uri' => array('allowEmpty' => true)), $parameters, array('presence' => 'required'));
if ($input->hasInvalid() or $input->hasMissing()) {
throw new Vtx_UserException($this->messageErrorEmpty);
}
return $input;
}
示例3: _filterInputServiceArea
protected function _filterInputServiceArea($params)
{
$input = new Zend_Filter_Input(array(), array('regional_id' => array('NotEmpty', 'presence' => 'required'), 'StateId' => array('allowEmpty' => true), 'CityId' => array('allowEmpty' => true), 'NeighborhoodId' => array('allowEmpty' => true)), $params);
if ($input->hasInvalid() || $input->hasMissing()) {
throw new Vtx_UserException(Model_ErrorMessage::getFirstMessage($input->getMessages()));
}
return $input;
}
示例4: _filterInputEnterpriseProgramaRank
protected function _filterInputEnterpriseProgramaRank($params)
{
$input = new Zend_Filter_Input(array('*' => array('StripTags', 'StringTrim')), array('enterprise_id_key' => array('allowEmpty' => true), 'user_id' => array('allowEmpty' => true), 'programa_id' => array('allowEmpty' => true), 'classificar' => array('allowEmpty' => true), 'desclassificar' => array('allowEmpty' => true), 'justificativa' => array('allowEmpty' => true), 'classificado_verificacao' => array('allowEmpty' => true), 'desclassificado_verificacao' => array('allowEmpty' => true), 'motivo_desclassificado_verificacao' => array('allowEmpty' => true), 'classificado_ouro' => array('allowEmpty' => true), 'classificado_prata' => array('allowEmpty' => true), 'classificado_bronze' => array('allowEmpty' => true), 'desclassificado_final' => array('allowEmpty' => true), 'motivo_desclassificado_final' => array('allowEmpty' => true), 'classificar_nacional' => array('allowEmpty' => true), 'desclassificar_nacional' => array('allowEmpty' => true), 'motivo_desclassificado_nacional' => array('allowEmpty' => true), 'classificar_fase2_nacional' => array('allowEmpty' => true), 'desclassificar_fase2_nacional' => array('allowEmpty' => true), 'motivo_desclassificado_fase2_nacional' => array('allowEmpty' => true), 'classificado_ouro_nacional' => array('allowEmpty' => true), 'classificado_prata_nacional' => array('allowEmpty' => true), 'classificado_bronze_nacional' => array('allowEmpty' => true), 'classificar_fase3_nacional' => array('allowEmpty' => true), 'desclassificar_fase3_nacional' => array('allowEmpty' => true), 'motivo_desclassificado_fase3_nacional' => array('allowEmpty' => true)), $params);
if ($input->hasInvalid() || $input->hasMissing()) {
throw new Vtx_UserException(Model_ErrorMessage::getFirstMessage($input->getMessages()));
}
return $input;
}
示例5: _filterInputAnnualResultData
protected function _filterInputAnnualResultData($params)
{
$input = new Zend_Filter_Input(array('*' => array('StripTags', 'StringTrim'), 'value' => array(array('Alnum', array('allowwhitespace' => true))), 'Year' => array(array('Digits', array('allowwhitespace' => true)))), array('annual_result_id' => array('NotEmpty'), 'year' => array('allowEmpty' => true), 'value' => array('allowEmpty' => true)), $params, array('presence' => 'required'));
if ($input->hasInvalid() || $input->hasMissing()) {
throw new Vtx_UserException(Model_ErrorMessage::getFirstMessage($input->getMessages()));
}
return $input;
}
示例6: _filterInputLogCadastroEmpresa
protected function _filterInputLogCadastroEmpresa($params)
{
$input = new Zend_Filter_Input(array(), array('user_id_log' => array('NotEmpty', 'presence' => 'required'), 'enterprise_id' => array('NotEmpty', 'messages' => array('Erro ao cadastrar empresa.'), 'presence' => 'required'), 'programa_id' => array('NotEmpty', 'messages' => array('Erro ao cadastrar empresa.'), 'presence' => 'required'), 'acao' => array('NotEmpty', 'messages' => array('Erro ao cadastrar empresa.'), 'presence' => 'required')), $params, array());
if ($input->hasInvalid() || $input->hasMissing()) {
throw new Vtx_UserException(Model_ErrorMessage::getFirstMessage($input->getMessages()));
}
return $input;
}
示例7: _filterInputUserLocality
protected function _filterInputUserLocality($params)
{
$input = new Zend_Filter_Input(array(), array('user_id' => array('NotEmpty', 'presence' => 'required'), 'enterprise_id' => array('allowEmpty' => true), 'regional_id' => array('allowEmpty' => true)), $params);
if ($input->hasInvalid() || $input->hasMissing()) {
throw new Vtx_UserException(Model_ErrorMessage::getFirstMessage($input->getMessages()));
}
return $input;
}
示例8: _filterInputAnnualResult
protected function _filterInputAnnualResult($params)
{
$input = new Zend_Filter_Input(array('*' => array('StringTrim'), 'value' => array()), array('question_id' => array(), 'mask' => array('NotEmpty', 'messages' => array('Escolha a máscara do Resultado Anual.')), 'value' => array('NotEmpty', 'messages' => array('Escolha o nome do Resultado Anual.'))), $params, array('presence' => 'required'));
if ($input->hasInvalid() || $input->hasMissing()) {
throw new Vtx_UserException(Model_ErrorMessage::getFirstMessage($input->getMessages()));
}
return $input;
}
示例9: _filterInputEmailQueue
protected function _filterInputEmailQueue($params)
{
$input = new Zend_Filter_Input(array('*' => array('StripTags', 'StringTrim'), 'answer_value' => array(array('Alnum', array('allowwhitespace' => true)))), array('alternative_id' => array('NotEmpty'), 'answer_value' => array('allowEmpty' => true), 'start_time' => array('allowEmpty' => true), 'end_time' => array('allowEmpty' => true), 'answer_date' => array('allowEmpty' => true), 'user_id' => array('NotEmpty'), 'logged_user_id' => array('NotEmpty')), $params, array('presence' => 'required'));
if ($input->hasInvalid() || $input->hasMissing()) {
throw new Vtx_UserException(Model_ErrorMessage::getFirstMessage($input->getMessages()));
}
return $input;
}
示例10: _filterInputAddressPresident
protected function _filterInputAddressPresident($params)
{
$input = new Zend_Filter_Input(array('cep' => array(array('Alnum', array('allowwhitespace' => true)), array('StripTags', 'StringTrim')), 'street_name_full' => array(array('Alnum', array('allowwhitespace' => true)), array('StripTags', 'StringTrim'))), array('address_id' => array('allowEmpty' => true), 'president_id' => array('NotEmpty', 'presence' => 'required'), 'cep' => array('NotEmpty', 'messages' => array('Digite apenas números no CEP da candidata.'), 'presence' => 'required'), 'state_id' => array('NotEmpty', 'messages' => array('Escolha o estado da candidata.')), 'city_id' => array('NotEmpty', 'messages' => array('Escolha a cidade da candidata.')), 'neighborhood_id' => array('NotEmpty', 'messages' => array('Escolha o bairro da candidata.')), 'name_full_log' => array('NotEmpty', 'messages' => array('Digite o nome da Rua da candidata.')), 'street_number' => array('NotEmpty', 'messages' => array('Digite o Número da Rua da candidata.')), 'street_completion' => array('allowEmpty' => true)), $params);
if ($input->hasInvalid() || $input->hasMissing()) {
throw new Vtx_UserException(Model_ErrorMessage::getFirstMessage($input->getMessages()));
}
return $input;
}
示例11: _filterInputBlock
protected function _filterInputBlock($params)
{
$input = new Zend_Filter_Input(array('*' => array('StripTags', 'StringTrim'), 'value' => array(array('Alnum', array('allowwhitespace' => true))), 'long_description' => array(), 'conclusion_text' => array(array('Alnum', array('allowwhitespace' => true)))), array('questionnaire_id' => array('NotEmpty'), 'designation' => array('allowEmpty' => true), 'value' => array('NotEmpty', 'messages' => array('O nome do bloco não pode ser vazio.')), 'long_description' => array('allowEmpty' => true), 'conclusion_text' => array('allowEmpty' => true)), $params, array('presence' => 'required'));
if ($input->hasInvalid() || $input->hasMissing()) {
throw new Vtx_UserException(Model_ErrorMessage::getFirstMessage($input->getMessages()));
}
return $input;
}
示例12: _filterInputRoleQuestionnaire
protected function _filterInputRoleQuestionnaire($params)
{
$input = new Zend_Filter_Input(array(), array('role_id' => array('NotEmpty', 'messages' => array('Escolha o Papel (perfil)')), 'questionnaire_id' => array('NotEmpty', 'messages' => array('Escolha o questionário')), 'start_date' => array('NotEmpty', new Zend_Validate_Date('dd/MM/yyyy')), 'end_date' => array('NotEmpty', new Zend_Validate_Date('dd/MM/yyyy'))), $params, array('presence' => 'required'));
if ($input->hasInvalid() || $input->hasMissing()) {
throw new Vtx_UserException(Model_ErrorMessage::getFirstMessage($input->getMessages()));
}
return $input;
}
示例13: _filterInputAnswerFeedbackImprove
protected function _filterInputAnswerFeedbackImprove($params)
{
$input = new Zend_Filter_Input(array('*' => array('StripTags', 'StringTrim')), array('user_id' => array('NotEmpty'), 'answer_id' => array('NotEmpty'), 'feedback_improve' => array('NotEmpty')), $params, array('presence' => 'required'));
if ($input->hasInvalid() || $input->hasMissing()) {
throw new Vtx_UserException(Model_ErrorMessage::getFirstMessage($input->getMessages()));
}
return $input;
}
示例14: _filterInputPresident
protected function _filterInputPresident($params)
{
$input = new Zend_Filter_Input(array('*' => array('StripTags', 'StringTrim'), 'name' => array(), 'cpf' => array('Digits')), array('enterprise_id' => array('NotEmpty', 'presence' => 'required'), 'education_id' => array('NotEmpty', 'messages' => array('Escolha o Nivel de Escolaridade.'), 'presence' => 'required'), 'position_id' => array('NotEmpty', 'messages' => array('Escolha o Cargo.'), 'presence' => 'required'), 'find_us_id' => array('NotEmpty', 'messages' => array('Selecione o item como nos conheceu.'), 'presence' => 'required'), 'name' => array('NotEmpty', 'messages' => array('Digite o Nome da candidata.'), 'presence' => 'required'), 'nick_name' => array('allowEmpty' => true), 'cpf' => array('NotEmpty', 'messages' => array('Digite o CPF.'), new Vtx_Validate_Cpf()), 'email' => array('allowEmpty' => true), 'phone' => array('allowEmpty' => true), 'cellphone' => array('allowEmpty' => true), 'born_date' => array('NotEmpty', 'messages' => array('Digite a Data de Nascimento.'), 'presence' => 'required', new Zend_Validate_Date('dd/MM/yyyy')), 'gender' => array('allowEmpty' => true), 'newsletter_email' => array('allowEmpty' => true), 'newsletter_mail' => array('allowEmpty' => true), 'newsletter_sms' => array('allowEmpty' => true), 'agree' => array('NotEmpty', 'messages' => array('É necessário aceitar o regulamento'), 'presence' => 'required'), 'created' => array('allowEmpty' => true)), $params, array());
if ($input->hasInvalid() || $input->hasMissing()) {
throw new Vtx_UserException(Model_ErrorMessage::getFirstMessage($input->getMessages()));
}
return $input;
}
示例15: _filterInputGroup
protected function _filterInputGroup($params)
{
$input = new Zend_Filter_Input(array('name' => array(), 'description' => array()), array('name' => array('NotEmpty', 'messages' => array('O Nome não pode ser vazio.')), 'description' => array('NotEmpty', 'messages' => array('A Descrição não pode ser vazia.'))), $params, array('presence' => 'required'));
if ($input->hasInvalid() || $input->hasMissing()) {
throw new Vtx_UserException(Model_ErrorMessage::getFirstMessage($input->getMessages()));
}
return $input;
}