/**
  * Check whether a field has been modified 
  * 
  * @param string $field Field name
  * @param mixed  $value [optional] Check if modified to given value
  * 
  * @return boolean
  */
 function fieldModified($field, $value = null)
 {
     // Field is not valued or Nothing in base
     if ($this->{$field} === null || !$this->_id) {
         return false;
     }
     // Load DB version
     $this->loadOldObject();
     if (!$this->_old->_id) {
         return false;
     }
     $spec = $this->_specs[$field];
     // Not formally deterministic case for floats
     if ($spec instanceof CFloatSpec) {
         return !CFloatSpec::equals($this->{$field}, $this->_old->{$field}, $spec);
     }
     // Check against a specific value
     if ($value !== null && $this->{$field} != $value) {
         return false;
     }
     // Has it finally been modified ?
     return $this->{$field} != $this->_old->{$field};
 }
Exemplo n.º 2
0
 /**
  * @see parent::getLitteralDescription()
  */
 function getLitteralDescription()
 {
     return "Nombre réel . " . parent::getLitteralDescription();
 }
Exemplo n.º 3
0
 /**
  * @see parent::getLitteralDescription()
  */
 function getLitteralDescription()
 {
     return "Booléen au format : '0, 1'" . parent::getLitteralDescription();
 }
Exemplo n.º 4
0
 /**
  * Chargement du secteur 1 du tarif
  * 
  * @return $this->_secteur1_uptodate
  **/
 function getSecteur1Uptodate()
 {
     if (!$this->codes_ngap && !$this->codes_ccam || !$this->codes_tarmed && !$this->codes_caisse) {
         return $this->_secteur1_uptodate = "1";
     }
     // Backup ...
     $secteur1 = $this->secteur1;
     $codes_ccam = $this->_codes_ccam;
     $codes_ngap = $this->_codes_ngap;
     $codes_tarmed = $this->_codes_tarmed;
     $codes_caisse = $this->_codes_caisse;
     // Compute...
     $this->_update_montants = true;
     $new_secteur1 = $this->updateMontants();
     // ... and restore
     $this->secteur1 = $secteur1;
     $this->_codes_ccam = $codes_ccam;
     $this->_codes_ngap = $codes_ngap;
     $this->_codes_tarmed = $codes_tarmed;
     $this->_codes_caisse = $codes_caisse;
     return $this->_secteur1_uptodate = CFloatSpec::equals($secteur1, $new_secteur1, $this->_specs["secteur1"]) ? "1" : "0";
 }