/**
  * @param BasicEntity $entityInstance
  * @return string
  */
 public static function buildFormAction($entityInstance)
 {
     $identifier = $entityInstance->getIdentifier();
     if (in_array(BasicEntity::UNSAVED_INSTANCE_ID, $identifier)) {
         $action = SAVE_DEFAULT_FILE_NAME;
     } else {
         $action = HttpEntityParamBuilder::buildArgumentsRelativePath(UPDATE_DEFAULT_FILE_NAME, $identifier);
     }
     return $action;
 }
 /**
  * @return string
  */
 public function buildEntityFormHTML()
 {
     $properties = $this->entityInstance->getProperties();
     foreach ($properties as $property) {
         if ($property->isShown()) {
             $property->buildFormBlock($this->formViewGenerator, $property->getName());
         }
     }
     unset($property);
     $this->formViewGenerator->appendSubmitButton(CREATE_BUTTON_TEXT);
     return $this->formViewGenerator->getBuiltHTML();
 }
 /**
  * @return bool
  */
 public function delete()
 {
     $filters = $this->entityInstance->getIdentifier();
     $deleteQuery = new DeleteQuery($this->tableName, $filters);
     $result = $deleteQuery->exec();
     return $result;
 }
 /**
  * @param bool $isCorrect
  */
 public function changePasswordAndRedirect($isCorrect)
 {
     $changePasswordFilePath = 'personal/' . CHANGE_PASSWORD_FILE;
     if (!$isCorrect) {
         $this->redirectForError($changePasswordFilePath, REPORT_PASSWORD_MISMATCH);
     }
     try {
         $this->entityInstance->update();
         $this->redirectToPath(CHANGE_PASSWORD_FILE);
     } catch (MySQLException $e) {
         $this->redirectForError($changePasswordFilePath, REPORT_PASSWORD_MISMATCH);
     }
 }
示例#5
0
 /**
  * @return Exam
  */
 public function update()
 {
     $this->validateSecretaries();
     return parent::update();
 }
示例#6
0
 /**
  * @return Exam
  */
 public function update()
 {
     $this->validateProfessors();
     return parent::update();
 }
示例#7
0
 public function unsetPassword()
 {
     parent::unsetProperty(self::PROP_PASSWORD);
 }