Example #1
0
 /**
 * This function performs the validation work for complex object models.
 *
 * In addition to checking the current object, all related objects will
 * also be validated.  If all pass then <code>true</code> is returned; otherwise
 * an aggreagated array of ValidationFailed objects will be returned.
 *
 * @param      array $columns Array of column names to validate.
 * @return     mixed <code>true</code> if all validations pass; 
               array of <code>ValidationFailed</code> objects otherwise.
 */
 protected function doValidate($columns = null)
 {
     if (!$this->alreadyInValidation) {
         $this->alreadyInValidation = true;
         $retval = null;
         $failureMap = array();
         if (($retval = UsersPeer::doValidate($this, $columns)) !== true) {
             $failureMap = array_merge($failureMap, $retval);
         }
         $this->alreadyInValidation = false;
     }
     return !empty($failureMap) ? $failureMap : true;
 }
Example #2
0
 /**
  * This function performs the validation work for complex object models.
  *
  * In addition to checking the current object, all related objects will
  * also be validated.  If all pass then <code>true</code> is returned; otherwise
  * an aggreagated array of ValidationFailed objects will be returned.
  *
  * @param      array $columns Array of column names to validate.
  * @return     mixed <code>true</code> if all validations pass; array of <code>ValidationFailed</code> objets otherwise.
  */
 protected function doValidate($columns = null)
 {
     if (!$this->alreadyInValidation) {
         $this->alreadyInValidation = true;
         $retval = null;
         $failureMap = array();
         if (($retval = UsersPeer::doValidate($this, $columns)) !== true) {
             $failureMap = array_merge($failureMap, $retval);
         }
         if ($this->collUserBikess !== null) {
             foreach ($this->collUserBikess as $referrerFK) {
                 if (!$referrerFK->validate($columns)) {
                     $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
                 }
             }
         }
         if ($this->collUserEquipements !== null) {
             foreach ($this->collUserEquipements as $referrerFK) {
                 if (!$referrerFK->validate($columns)) {
                     $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
                 }
             }
         }
         if ($this->singleUserInformation !== null) {
             if (!$this->singleUserInformation->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->singleUserInformation->getValidationFailures());
             }
         }
         if ($this->singleUserProfile !== null) {
             if (!$this->singleUserProfile->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->singleUserProfile->getValidationFailures());
             }
         }
         if ($this->collUserRidess !== null) {
             foreach ($this->collUserRidess as $referrerFK) {
                 if (!$referrerFK->validate($columns)) {
                     $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
                 }
             }
         }
         $this->alreadyInValidation = false;
     }
     return !empty($failureMap) ? $failureMap : true;
 }