Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Multiple function call fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiocarneiro committed Mar 18, 2014
1 parent 18f9185 commit d00e4aa
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/CollectionInputFilter.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

/**
* Zend Framework (http://framework.zend.com/)
*
Expand Down Expand Up @@ -147,6 +146,7 @@ public function setData($data)
*/
public function isValid()
{
$inputFilter = $this->getInputFilter();
$valid = true;

if ($this->getCount() < 1) {
Expand All @@ -170,22 +170,22 @@ public function isValid()
if (!is_array($data)) {
$data = array();
}
$this->getInputFilter()->setData($data);
$inputFilter->setData($data);

if (null !== $this->validationGroup) {
$this->getInputFilter()->setValidationGroup($this->validationGroup[$key]);
$inputFilter->setValidationGroup($this->validationGroup[$key]);
}

if ($this->getInputFilter()->isValid()) {
$this->validInputs[$key] = $this->getInputFilter()->getValidInput();
if ($inputFilter->isValid()) {
$this->validInputs[$key] = $inputFilter->getValidInput();
} else {
$valid = false;
$this->collectionMessages[$key] = $this->getInputFilter()->getMessages();
$this->invalidInputs[$key] = $this->getInputFilter()->getInvalidInput();
$this->collectionMessages[$key] = $inputFilter->getMessages();
$this->invalidInputs[$key] = $inputFilter->getInvalidInput();
}

$this->collectionValues[$key] = $this->getInputFilter()->getValues();
$this->collectionRawValues[$key] = $this->getInputFilter()->getRawValues();
$this->collectionValues[$key] = $inputFilter->getValues();
$this->collectionRawValues[$key] = $inputFilter->getRawValues();
}

return $valid;
Expand Down Expand Up @@ -250,5 +250,4 @@ public function getMessages()
{
return $this->collectionMessages;
}

}

0 comments on commit d00e4aa

Please sign in to comment.