Setter générique
771265
public function set($property, $value) {

    // Vérification que la propriété existe bien
		if ($this->isProperty($property)) {

			// Si le type de la propriété est connu...
			/*if ($this->properties[$property]->type() != null) {

				// Forçage des types majeurs
				switch ($this->properties[$property]->type()) {
					case 'boolean':  $value_typed = (boolean)$value; break;
					case 'integer':  $value_typed = (int)$value;		 break;
					case 'string':   $value_typed = (string)$value;	 break;
					case 'array':    $value_typed = $value;				   break;
					case 'datetime': $value_typed = $value;				   break;
					case 'date':     $value_typed = $value;			     break;
					default:         $value_typed = $value;			     break;
				}

				$current_type = gettype($value_typed);

				if ($current_type != 'object') {
					if ($current_type == $this->properties[$property]->type() ||
              $current_type == NULL ||
              $this->properties[$property]->type() == 'date' ||
              $this->properties[$property]->type() == 'datetime') {
						if ($current_type == 'NULL') { $current_type = NULL; }
						$this->properties[$property]->setValue($value_typed);
					} else {
              throw new Exception("le type '".$this->properties[$property]["type"]."' de la propriété '".$property."' est invalide : '".$value_typed."' => '".$current_type."'", '00010006');
					}
				} else {
					if (is_a($value, $this->properties[$property]->type()) || $current_type == NULL || $current_type == 'NULL') {
						if ($current_type == 'NULL') { $current_type = NULL; }
						//$this->properties[$property]["value"] = $value;
            $this->properties[$property]->setValue($value);
					} else {
            throw new Exception("le type '".$this->properties[$property]["type"]."' de la propriété '".$property."' est invalide : '".$value_typed."' => '".$current_type."'", '00010006');
					}
				}
			} else {*/
				//$this->properties[$property]["value"] = $value;

        $this->properties[$property]->setValue($value);
			//}
		}
	}
1220935
def _setter(self, attr, value, bottom, top, to_step):
        
        if value < 0 or value > 1:
            raise ValueError("out of range")
        if value == 0.0:
            bottom()
        elif value == 1.0:
            top()
        else:
            to_step(value)
        setattr(self, attr, value)
416533
public function saveInterest(){
		$t = new Template($this->getCheminPhysique().$this->cheminTemplates."interest/");
		$t->set_filenames(array('confirm'=>'confirm.tpl'));
		
		$urlBack = $this->creerUrl('', 'mesInterets', array());
		$txtLink = "Revenir à la liste de mes intérêts";
		
		if(isset($this->variablesPost) && !empty($this->variablesPost)){
			$interets = $this->variablesPost;
		}
		elseif (isset($this->variablesGet) && !empty($this->variablesGet)){
			$interets = $this->variablesGet;
		}
		
		
		
		/*
		 * Initially, it was adding related nesting element in the interests of the user
		 * Client asked to add only the smallest element in interest (if neighborhood selected, don't add the city and the country)
		 * Little array handling to satified the client need, to revert, delete the two following loops 
		 */
		foreach ($interets as $key => $int){
			if($int== 0){
				unset($interets[$key]);
			}
		}
		while(count($interets)>1){
			array_shift($interets);
		}
		
		
		$requestParameters = array();
		if($interets['rue']!=0){
			$requestParameters[]=array('table'=>'_interetRue','fieldName1'=>'idUtilisateur','fieldName2'=>'idRue','idInteret'=>$interets['rue'],'userId'=>$this->userId);
		}
		if($interets['sousQuartier']!=0){
			$requestParameters[]=array('table'=>'_interetSousQuartier','fieldName1'=>'idUtilisateur','fieldName2'=>'idSousQuartier','idInteret'=>$interets['sousQuartier'],'userId'=>$this->userId);
		}
		if($interets['quartier']!=0){
			$requestParameters[]=array('table'=>'_interetQuartier','fieldName1'=>'idUtilisateur','fieldName2'=>'idQuartier','idInteret'=>$interets['quartier'],'userId'=>$this->userId);
		}
		if($interets['ville']!=0){
			$requestParameters[]=array('table'=>'_interetVille','fieldName1'=>'idUtilisateur','fieldName2'=>'idVille','idInteret'=>$interets['ville'],'userId'=>$this->userId);
		}
		if($interets['pays']!=0){
			$requestParameters[]=array('table'=>'_interetPays','fieldName1'=>'idUtilisateur','fieldName2'=>'idPays','idInteret'=>$interets['pays'],'userId'=>$this->userId);
		}
		if($interets['adresse']!=0){
			$idHistoriqueAdresse = $interets['adresse'];
			$requestParameters[]=array('table'=>'_interetAdresse','fieldName1'=>'idUtilisateur','fieldName2'=>'idHistoriqueAdresse','idInteret'=>$interets['adresse'],'userId'=>$this->userId);
			
			$requete = "
					SELECT ae.idEvenement as idEvenementGroupeAdresse, ae.idAdresse as idAdresse 
					FROM _adresseEvenement ae
					LEFT JOIN historiqueAdresse ha on ha.idAdresse = ae.idAdresse 
					WHERE ha.idHistoriqueAdresse  = ".$idHistoriqueAdresse."
					";			
			$result = $this->connexionBdd->requete($requete);
			$fetch = mysql_fetch_array($result);
			$idAdresse = $fetch['idAdresse'];
			$idEvenementGroupeAdresse = $fetch['idEvenementGroupeAdresse'];
			
			$evenement = new archiEvenement();
			$titreAdresse = $evenement->getIntituleAdresseFrom($idAdresse,'idAdresse');
			
			$urlBack = $this->creerUrl('','',array('archiAffichage'=>'adresseDetail','archiIdAdresse'=>$idAdresse,'archiIdEvenementGroupeAdresse'=>$idEvenementGroupeAdresse));
			$txtLink="Aller à l'adresse " . $titreAdresse;
		}
		if($interets['personne']){
			$requestParameters[]=array('table'=>'_interetPersonne','fieldName1'=>'idUtilisateur','fieldName2'=>'idPersonne','idInteret'=>$interets['personne'],'userId'=>$this->userId);
			$urlBack = $this->creerUrl('', 'evenementListe', array('selection' => 'personne', 'id' => $interets['personne']));
			$txtLink = "Retour à la fiche de la personne";
		}

		$nbEltInserted=0;
		foreach ($requestParameters as $rp){
			//Insert if not exists
			$requete= "
					INSERT INTO ".$rp['table']." (".$rp['fieldName1'].",".$rp['fieldName2'].",created)
					SELECT '".$this->userId."', '".$rp['idInteret']."' , now()
					FROM DUAL
					WHERE NOT EXISTS (SELECT * FROM `".$rp['table']."`
					WHERE ".$rp['fieldName1']."='".$this->userId."' AND ".$rp['fieldName2']."='".$rp['idInteret']."')
					LIMIT 1
					";
			$res = $this->connexionBdd->requete($requete,false);
		}
		$this->messages->addConfirmation('Intérêt(s) sauvegardé(s) avec succès !');
		$t->assign_vars(array(
				'message' =>  $this->messages->display(),
				'textLink' => $txtLink,
				'urlBack'=> $urlBack
		)); 
		ob_start();
		$t->pparse('confirm');
		$html .= ob_get_contents();
		ob_end_clean();
		return $html;
	}
1226623
public function afficheStatistiques()
	{
		$t = new Template($this->getCheminPhysique().$this->cheminTemplates);
		$t->set_filenames(array('statsAccueil'=>'statistiquesAccueil.tpl'));

		// recherche du nombre d'evenements
		$reqEvenements = "SELECT DISTINCT idEvenement as nbEvenements FROM evenements;";
		$resEvenements = $this->connexionBdd->requete($reqEvenements);

		// recherche du nombre d'adresses
		$reqAdresses = "SELECT DISTINCT idAdresse as nbAdresses FROM historiqueAdresse;";
		$resAdresses = $this->connexionBdd->requete($reqAdresses);

		// recherche du nombre de photos
		$reqPhotos = "SELECT DISTINCT idImage as nbImages FROM historiqueImage;";
		$resPhotos = $this->connexionBdd->requete($reqPhotos);

		$t->assign_vars(array('architectes'=>$this->getListeArchitectesProductifs(array('sqlLimit'=>"LIMIT 10", "noPagination"=>true))));
		$t->assign_vars(array('rues'=>$this->getListeRuesCompletes(array('sqlLimit'=>"LIMIT 10", "noPagination"=>true))));

		$t->assign_vars(array('voirTousLesArchitectes'=>"<a href='".$this->creerUrl('', 'tousLesArchitectesClasses')."'>"._("Voir tous les architectes classés")."</a>"));

		$t->assign_vars(array('voirToutesLesRues'=>"<a href='".$this->creerUrl('', 'toutesLesRuesCompletesClassees')."'>"._("Voir toutes les rues classées")."</a>"));

		$t->assign_vars(array('nbAdresses'=>mysql_num_rows($resAdresses)));
		$t->assign_vars(array('nbEvenements'=>mysql_num_rows($resEvenements)));
		$t->assign_vars(array('nbPhotos'=>mysql_num_rows($resPhotos)));

		ob_start();
		$t->pparse('statsAccueil');
		$html .= ob_get_contents();
		ob_end_clean();

		return $html;
	}
670146
def set(self, x):
        
        for name, value in iter(x.items()):
            if hasattr(value, "ndim"):
                if self[name].value.ndim < value.ndim:
                    self[name].value.itemset(value.squeeze())
                else:
                    self[name].value = value
            else:
                self[name].value.itemset(value)
182749
private function ___set($name, $value)
    {
        /**
         * @var PropertyContract $meta
         */
        $meta = self::$schema->getPropertyEntryByIdentifier($name);

        if (!$meta) {
            return;
        }

        $isRequired = $meta->getBehavior()->isRequired();

        if (is_null($value) && $isRequired) {
            throw new Exception("Propriedade obrigatória não pode ser nula [ " . $name . " ]", 400);
        }

        if ($value) {
            $value = Validator::make(self::$schema)->validate($name, $value);

            if ($meta->getAllowedValues()) {

                if (!in_array($value, $meta->getAllowedValues())) {

                    $msg = "Valor [ {$value} ] para [ {$name} ] esta fora do intervalo permitido ";
                    $msg .= '[ ' . implode(',', $meta->getAllowedValues()) . ' ]';

                    throw new Exception($msg, 400);
                }
            }
        }

        if (method_exists($this, 'set' . ucfirst($name))) {
            $this->{'set' . ucfirst($name)}($value);
        } else {
            $this->{$name} = $value;
        }
    }
352639
function setAttr(setModel, newValue, setOptions) {
      var oldValue = model._containedModels[attrName];

      // Pass through if removing
      if (newValue === undefined || newValue === null) {
        model._containedModels[attrName] = newValue;
        return;
      }

      // Is the new value the correct type?
      if (newValue instanceof Ctor) {

        // Directly set if no old value
        if (!oldValue instanceof Ctor) {
          model._containedModels[attrName] = newValue;
          return;
        }

        // They're both models.  Disregard if they're the same.
        var oldJSON = oldValue.toJSON({deep:true});
        var newJSON = newValue.toJSON({deep:true});
        if (_.isEqual(oldJSON, newJSON)) {
          return;
        }

        // Merge the raw JSON if they're both models
        newValue = newJSON;
      }

      // Keep the previous model and merge new data into it
      // For collections this relies on the Collection.set() method
      if (oldValue instanceof Ctor) {
        model.attributes[attrName] = oldValue;
        model._currentAttributes[attrName] = oldValue;
        model.changed[attrName] = oldValue;
        oldValue.set(newValue, setOptions);
        return;
      }

      // Create a new model or collection, passing the value
      newValue =
        model._containedModels[attrName] =
        model.attributes[attrName] =
        model._currentAttributes[attrName] =
        new Ctor(newValue, setOptions);

      // Watch for changes to the underlying model or collection
      // (collection add/remove), forwarding changes to this model
      newValue.on('change add remove reset', UI.onSubModelChange, {
        parent:model,
        attrName: attrName
      });
    }
511112
def _setse(self, i):
        """"""
        if i > 0:
            u = (i * 2) - 1
        else:
            u = -2 * i
        self._setue(u)
312761
def setter_generator(field_name):
    
    def set_translation_field(cls, value, language_code=None):
        setattr(cls.get_translation(language_code, True),
                field_name, value)
    set_translation_field.short_description = "set " + field_name
    return set_translation_field
160827
@Override
    public Object setE(int key, Object value) throws ExpressionException {
	if (offset + key > arr.length) enlargeCapacity(key);
	if (key > size) size = key;
	arr[(offset + key) - 1] = checkValue(value);
	return value;
    }
1091610
public PropertySetting propertySetting(PropertySetting setter) {
    PropertySetting previous = this.setter;
    this.setter = Objects.requireNonNull(setter);
    return previous;
  }
889709
function set(publicAPI, model = {}, names = []) {
  names.forEach((name) => {
    publicAPI[`set${capitalize(name)}`] = (value) => {
      model[name] = value;
    };
  });
}
165661
private void directSetter(Field field) {
    GeneratorAdapter mg = new GeneratorAdapter(Opcodes.ACC_PUBLIC,
                                               getMethod(void.class, "set", Object.class, Object.class),
                                               setterSignature(), new Type[0], classWriter);
    // Simply access by field
    // ((classType)object).fieldName = (valueType)value;
    mg.loadArg(0);
    mg.checkCast(Type.getType(field.getDeclaringClass()));
    mg.loadArg(1);
    if (field.getType().isPrimitive()) {
      mg.unbox(Type.getType(field.getType()));
    } else {
      mg.checkCast(Type.getType(field.getType()));
    }
    mg.putField(Type.getType(field.getDeclaringClass()), field.getName(), Type.getType(field.getType()));
    mg.returnValue();
    mg.endMethod();
  }
102947
def _setter(self):
        
        def set_attr_value(obj, value):
            if value is None or value == self._default:
                if self._clark_name in obj.attrib:
                    del obj.attrib[self._clark_name]
                return
            str_value = self._simple_type.to_xml(value)
            obj.set(self._clark_name, str_value)
        return set_attr_value
550292
function link($timeout, $compile, scope, ngelt, attrs, ctrl) {
		ctrl.reItems = new RegExp("\s?limitTo\s?\:\s?" + attrs.ngLimit + "\s?\:\s?" + attrs.ngBegin + ""); // pour déterminer quel items sont gerer
		scope.ngBegin = 0;
		scope.ngLimit = 1;
		ctrl.ngelt = ngelt; // on sauve l'element jquery
		ctrl.elt = getHtmlElement(ngelt); // on sauve l'element
		ctrl.ngsb = $compile("<span mode='hidden' class='scrollbar')></span>")(scope);
		var info = $compile("<span ng-show='ctrl.infos' class='infos-scrolling' ng-bind='ctrl.infos'></span>")(scope);
		ngelt.append(info);
		ngelt.append(ctrl.ngsb);
		ctrl.sb = getHtmlElement(ctrl.ngsb);
		var watcherClears = [];
		if (ngelt.css('display') === 'none') { // si c'est une popup, on surveille le display
			var watcherClear = scope.$watch(function (scope) {
				return scope.ctrl.ngelt.css('display');
			}, function (v1, v2, s) {
				if (v1 !== 'none') {
					if (s.max) {
						s.ngLimit = s.max;
						s.ctrl.updateTotal();
					} else {
						s.ngLimit = 1;
						s.ctrl.updateSize();
					}
					watcherClear();
				}
			});
			watcherClears.push(watcherClear);
		}
		if (ctrl.horizontal) {
			watcherClears.push(scope.$watch(function (scope) {
				return scope.ctrl.ngelt.width();
			}, function (v1, v2, s) {
				if (v1 !== v2) {
					s.ctrl.getScrollbarArea().invalid = true;
					s.ctrl.getEltArea().invalid = true;
					s.ctrl.updateSize();
				}
			}));
		} else {
			watcherClears.push(scope.$watch(function (scope) {
				return scope.ctrl.ngelt.height();
			}, function (v1, v2, s) {
				if (v1 !== v2) {
					s.ctrl.getScrollbarArea().invalid = true;
					s.ctrl.getEltArea().invalid = true;
					s.ctrl.updateSize();
				}
			}));
		}
		var totalTimer;
		watcherClears.push(scope.$watch('total', function (v1, v2, s) {
			if (v1 !== v2) {
				if(totalTimer) $timeout.cancel(totalTimer);
				totalTimer = $timeout(s.ctrl.updateTotal, s.debounce || DEBOUNCE, true);
			}
		}));
		var limitTimer;
		watcherClears.push(scope.$watch('ngLimit', function (v1, v2, s) {
			if (v1 !== v2) {
				if(limitTimer) $timeout.cancel(limitTimer);
				limitTimer = $timeout(s.ctrl.updateLimit, s.debounce || DEBOUNCE, true);
			}
		}));
		watcherClears.push(scope.$watch('ngBegin', function (v1, v2, s) {
			if (v1 >= 0 && v1 <= s.total - s.ctrl.getInnerLimit()) {
				s.ctrl.updateBegin();
			} else if (v1 < 0) {
				s.ngBegin = 0;
			} else {
				s.ngBegin = Math.max(s.total - s.ctrl.getInnerLimit(), 0);
			}
		}));
		scope.$on('$destroy', function () {
			ctrl.removeEventListeners();
			watcherClears.forEach(function (watcherClear) {
				watcherClear();
			});
		});
		ctrl.addEventListeners();
	}
993379
function createSetter(namespace, mappings) {
    let mutation = mappings.mutation;

    if (namespace) {
        mutation = namespace + '/' + mutation;
    }

    return function (value) {
        this.$store.commit(mutation, value)
    };
}
1326001
def setROI(self, *args):
        
        if len(args) == 4:
            x, y, w, h = args
        elif len(args) == 1:
            if isinstance(args[0], Region):
                x, y, w, h = args[0].getTuple()
            elif isinstance(args[0], tuple):
                x, y, w, h = args[0]
            else:
                raise TypeError("Unrecognized argument for Region()")
        else:
            raise TypeError("Unrecognized argument(s) for Region()")
        self.setX(x)
        self.setY(y)
        self.setW(w)
        self.setH(h)