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> objets otherwise.
  */
 protected function doValidate($columns = null)
 {
     if (!$this->alreadyInValidation) {
         $this->alreadyInValidation = true;
         $retval = null;
         $failureMap = array();
         // We call the validate method on the following object(s) if they
         // were passed to this object by their coresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aStatus !== null) {
             if (!$this->aStatus->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aStatus->getValidationFailures());
             }
         }
         if (($retval = ProjectPeer::doValidate($this, $columns)) !== true) {
             $failureMap = array_merge($failureMap, $retval);
         }
         if ($this->collJobs !== null) {
             foreach ($this->collJobs as $referrerFK) {
                 if (!$referrerFK->validate($columns)) {
                     $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
                 }
             }
         }
         $this->alreadyInValidation = false;
     }
     return !empty($failureMap) ? $failureMap : true;
 }
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     if (!empty(Input::get('name'))) {
         $val = Status::validate(Input::all());
         if ($val->fails()) {
             return Redirect::back()->withErrors($val);
         }
         try {
             $status = new Status();
             $status->name = Input::get('name');
             $status->save();
         } catch (Exception $e) {
             return Redirect::back()->with('message', FlashMessage::DisplayAlert('Status can NOT be created. Already exists.', 'alert'));
         }
         return Redirect::back()->with('message', FlashMessage::DisplayAlert('Status Created Successfully!', 'success'));
     }
     return Redirect::back()->with('message', FlashMessage::DisplayAlert('Enter a valid status name.', 'alert'));
 }
 /**
  * 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();
         // We call the validate method on the following object(s) if they
         // were passed to this object by their coresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aUser !== null) {
             if (!$this->aUser->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aUser->getValidationFailures());
             }
         }
         if ($this->aSchemaPropertyElement !== null) {
             if (!$this->aSchemaPropertyElement->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aSchemaPropertyElement->getValidationFailures());
             }
         }
         if ($this->aSchemaPropertyRelatedBySchemaPropertyId !== null) {
             if (!$this->aSchemaPropertyRelatedBySchemaPropertyId->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aSchemaPropertyRelatedBySchemaPropertyId->getValidationFailures());
             }
         }
         if ($this->aSchema !== null) {
             if (!$this->aSchema->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aSchema->getValidationFailures());
             }
         }
         if ($this->aProfileProperty !== null) {
             if (!$this->aProfileProperty->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aProfileProperty->getValidationFailures());
             }
         }
         if ($this->aSchemaPropertyRelatedByRelatedSchemaPropertyId !== null) {
             if (!$this->aSchemaPropertyRelatedByRelatedSchemaPropertyId->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aSchemaPropertyRelatedByRelatedSchemaPropertyId->getValidationFailures());
             }
         }
         if ($this->aStatus !== null) {
             if (!$this->aStatus->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aStatus->getValidationFailures());
             }
         }
         if ($this->aFileImportHistory !== null) {
             if (!$this->aFileImportHistory->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aFileImportHistory->getValidationFailures());
             }
         }
         if (($retval = SchemaPropertyElementHistoryPeer::doValidate($this, $columns)) !== true) {
             $failureMap = array_merge($failureMap, $retval);
         }
         $this->alreadyInValidation = false;
     }
     return !empty($failureMap) ? $failureMap : true;
 }
 /**
  * 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();
         // We call the validate method on the following object(s) if they
         // were passed to this object by their coresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aUserRelatedByCreatedUserId !== null) {
             if (!$this->aUserRelatedByCreatedUserId->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aUserRelatedByCreatedUserId->getValidationFailures());
             }
         }
         if ($this->aUserRelatedByUpdatedUserId !== null) {
             if (!$this->aUserRelatedByUpdatedUserId->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aUserRelatedByUpdatedUserId->getValidationFailures());
             }
         }
         if ($this->aConceptRelatedByConceptId !== null) {
             if (!$this->aConceptRelatedByConceptId->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aConceptRelatedByConceptId->getValidationFailures());
             }
         }
         if ($this->aProfilePropertyRelatedBySkosPropertyId !== null) {
             if (!$this->aProfilePropertyRelatedBySkosPropertyId->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aProfilePropertyRelatedBySkosPropertyId->getValidationFailures());
             }
         }
         if ($this->aVocabulary !== null) {
             if (!$this->aVocabulary->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aVocabulary->getValidationFailures());
             }
         }
         if ($this->aConceptRelatedByRelatedConceptId !== null) {
             if (!$this->aConceptRelatedByRelatedConceptId->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aConceptRelatedByRelatedConceptId->getValidationFailures());
             }
         }
         if ($this->aStatus !== null) {
             if (!$this->aStatus->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aStatus->getValidationFailures());
             }
         }
         if ($this->aProfilePropertyRelatedByProfilePropertyId !== null) {
             if (!$this->aProfilePropertyRelatedByProfilePropertyId->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aProfilePropertyRelatedByProfilePropertyId->getValidationFailures());
             }
         }
         if (($retval = ConceptPropertyPeer::doValidate($this, $columns)) !== true) {
             $failureMap = array_merge($failureMap, $retval);
         }
         if ($this->collConcepts !== null) {
             foreach ($this->collConcepts as $referrerFK) {
                 if (!$referrerFK->validate($columns)) {
                     $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
                 }
             }
         }
         if ($this->collConceptPropertyHistorys !== null) {
             foreach ($this->collConceptPropertyHistorys as $referrerFK) {
                 if (!$referrerFK->validate($columns)) {
                     $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
                 }
             }
         }
         if ($this->collDiscusss !== null) {
             foreach ($this->collDiscusss as $referrerFK) {
                 if (!$referrerFK->validate($columns)) {
                     $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
                 }
             }
         }
         $this->alreadyInValidation = false;
     }
     return !empty($failureMap) ? $failureMap : true;
 }
 /**
  * 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();
         // We call the validate method on the following object(s) if they
         // were passed to this object by their coresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aAgent !== null) {
             if (!$this->aAgent->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aAgent->getValidationFailures());
             }
         }
         if ($this->aUserRelatedByCreatedUserId !== null) {
             if (!$this->aUserRelatedByCreatedUserId->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aUserRelatedByCreatedUserId->getValidationFailures());
             }
         }
         if ($this->aUserRelatedByUpdatedUserId !== null) {
             if (!$this->aUserRelatedByUpdatedUserId->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aUserRelatedByUpdatedUserId->getValidationFailures());
             }
         }
         if ($this->aStatus !== null) {
             if (!$this->aStatus->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aStatus->getValidationFailures());
             }
         }
         if ($this->aProfile !== null) {
             if (!$this->aProfile->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aProfile->getValidationFailures());
             }
         }
         if (($retval = SchemaPeer::doValidate($this, $columns)) !== true) {
             $failureMap = array_merge($failureMap, $retval);
         }
         if ($this->collDiscusss !== null) {
             foreach ($this->collDiscusss as $referrerFK) {
                 if (!$referrerFK->validate($columns)) {
                     $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
                 }
             }
         }
         if ($this->collFileImportHistorys !== null) {
             foreach ($this->collFileImportHistorys as $referrerFK) {
                 if (!$referrerFK->validate($columns)) {
                     $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
                 }
             }
         }
         if ($this->collRdfNamespaces !== null) {
             foreach ($this->collRdfNamespaces as $referrerFK) {
                 if (!$referrerFK->validate($columns)) {
                     $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
                 }
             }
         }
         if ($this->collSchemaPropertys !== null) {
             foreach ($this->collSchemaPropertys as $referrerFK) {
                 if (!$referrerFK->validate($columns)) {
                     $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
                 }
             }
         }
         if ($this->collSchemaPropertyElementHistorys !== null) {
             foreach ($this->collSchemaPropertyElementHistorys as $referrerFK) {
                 if (!$referrerFK->validate($columns)) {
                     $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
                 }
             }
         }
         if ($this->collSchemaHasUsers !== null) {
             foreach ($this->collSchemaHasUsers as $referrerFK) {
                 if (!$referrerFK->validate($columns)) {
                     $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
                 }
             }
         }
         if ($this->collSchemaHasVersions !== null) {
             foreach ($this->collSchemaHasVersions as $referrerFK) {
                 if (!$referrerFK->validate($columns)) {
                     $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
                 }
             }
         }
         $this->alreadyInValidation = false;
     }
     return !empty($failureMap) ? $failureMap : true;
 }
 /**
  * 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();
         // We call the validate method on the following object(s) if they
         // were passed to this object by their coresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aUserRelatedByCreatedUserId !== null) {
             if (!$this->aUserRelatedByCreatedUserId->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aUserRelatedByCreatedUserId->getValidationFailures());
             }
         }
         if ($this->aUserRelatedByUpdatedUserId !== null) {
             if (!$this->aUserRelatedByUpdatedUserId->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aUserRelatedByUpdatedUserId->getValidationFailures());
             }
         }
         if ($this->aVocabulary !== null) {
             if (!$this->aVocabulary->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aVocabulary->getValidationFailures());
             }
         }
         if ($this->aStatus !== null) {
             if (!$this->aStatus->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aStatus->getValidationFailures());
             }
         }
         if (($retval = CollectionPeer::doValidate($this, $columns)) !== true) {
             $failureMap = array_merge($failureMap, $retval);
         }
         $this->alreadyInValidation = false;
     }
     return !empty($failureMap) ? $failureMap : true;
 }
 /**
  * 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();
         // We call the validate method on the following object(s) if they
         // were passed to this object by their coresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aAgent !== null) {
             if (!$this->aAgent->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aAgent->getValidationFailures());
             }
         }
         if ($this->aUserRelatedByCreatedBy !== null) {
             if (!$this->aUserRelatedByCreatedBy->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aUserRelatedByCreatedBy->getValidationFailures());
             }
         }
         if ($this->aUserRelatedByUpdatedBy !== null) {
             if (!$this->aUserRelatedByUpdatedBy->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aUserRelatedByUpdatedBy->getValidationFailures());
             }
         }
         if ($this->aUserRelatedByDeletedBy !== null) {
             if (!$this->aUserRelatedByDeletedBy->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aUserRelatedByDeletedBy->getValidationFailures());
             }
         }
         if ($this->aUserRelatedByChildUpdatedBy !== null) {
             if (!$this->aUserRelatedByChildUpdatedBy->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aUserRelatedByChildUpdatedBy->getValidationFailures());
             }
         }
         if ($this->aStatus !== null) {
             if (!$this->aStatus->validate($columns)) {
                 $failureMap = array_merge($failureMap, $this->aStatus->getValidationFailures());
             }
         }
         if (($retval = ProfilePeer::doValidate($this, $columns)) !== true) {
             $failureMap = array_merge($failureMap, $retval);
         }
         if ($this->collProfilePropertys !== null) {
             foreach ($this->collProfilePropertys as $referrerFK) {
                 if (!$referrerFK->validate($columns)) {
                     $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
                 }
             }
         }
         if ($this->collSchemas !== null) {
             foreach ($this->collSchemas as $referrerFK) {
                 if (!$referrerFK->validate($columns)) {
                     $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
                 }
             }
         }
         if ($this->collVocabularys !== null) {
             foreach ($this->collVocabularys as $referrerFK) {
                 if (!$referrerFK->validate($columns)) {
                     $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
                 }
             }
         }
         $this->alreadyInValidation = false;
     }
     return !empty($failureMap) ? $failureMap : true;
 }