<commit_before><?php
class placement
{
/**
    * @access private
    * @var int(10)
    */
	private $id;

	/**
    * @access private
    * @var varchar(50)
    */
	private $type;

	/**
    * @access private
    * @var tinyint(3)
    */
	private $x;

	/**
    * @access private
    * @var tinyint(3)
    */
	private $y;

	/**
    * @access private
    * @var tinyint(3)
    */
	private $royaume;

	/**
    * @access private
    * @var int(10)
    */
	private $debut_placement;

	/**
    * @access private
    * @var int(10)
    */
	private $fin_placement;

	/**
    * @access private
    * @var int(10)
    */
	private $id_batiment;

	/**
    * @access private
    * @var int(10)
    */
	private $hp;

	/**
    * @access private
    * @var varchar(50)
    */
	private $nom;

	/**
    * @access private
    * @var int(10)
    */
	private $rez;

	/**
    * @access private
    * @var tinyint(3)
    */
	private $point_victoire;

	
	/**
	* @access public

	* @param int(10) id attribut
	* @param varchar(50) type attribut
	* @param tinyint(3) x attribut
	* @param tinyint(3) y attribut
	* @param tinyint(3) royaume attribut
	* @param int(10) debut_placement attribut
	* @param int(10) fin_placement attribut
	* @param int(10) id_batiment attribut
	* @param int(10) hp attribut
	* @param varchar(50) nom attribut
	* @param int(10) rez attribut
	* @param tinyint(3) point_victoire attribut
	* @return none
	*/
	function __construct($id = 0, $type = '', $x = '', $y = '', $royaume = '', $debut_placement = '', $fin_placement = '', $id_batiment = '', $hp = '', $nom = '', $rez = '', $point_victoire = '')
	{
		global $db;
		//Verification nombre et du type d'argument pour construire l'etat adequat.
		if( (func_num_args() == 1) && is_numeric($id) )
		{
			$requeteSQL = $db->query("SELECT type, x, y, royaume, debut_placement, fin_placement, id_batiment, hp, nom, rez, point_victoire FROM placement WHERE id = ".$id);
			//Si le thread est dans la base, on le charge sinon on crée un thread vide.
			if( $db->num_rows($requeteSQL) > 0 )
			{
				list($this->type, $this->x, $this->y, $this->royaume, $this->debut_placement, $this->fin_placement, $this->id_batiment, $this->hp, $this->nom, $this->rez, $this->point_victoire) = $db->read_array($requeteSQL);
			}
			else $this->__construct();
			$this->id = $id;
		}
		elseif( (func_num_args() == 1) && is_array($id) )
		{
			$this->id = $id['id'];
			$this->type = $id['type'];
			$this->x = $id['x'];
			$this->y = $id['y'];
			$this->royaume = $id['royaume'];
			$this->debut_placement = $id['debut_placement'];
			$this->fin_placement = $id['fin_placement'];
			$this->id_batiment = $id['id_batiment'];
			$this->hp = $id['hp'];
			$this->nom = $id['nom'];
			$this->rez = $id['rez'];
			$this->point_victoire = $id['point_victoire'];
			}
		else
		{
			$this->type = $type;
			$this->x = $x;
			$this->y = $y;
			$this->royaume = $royaume;
			$this->debut_placement = $debut_placement;
			$this->fin_placement = $fin_placement;
			$this->id_batiment = $id_batiment;
			$this->hp = $hp;
			$this->nom = $nom;
			$this->rez = $rez;
			$this->point_victoire = $point_victoire;
			$this->id = $id;
		}
	}

	/**
	* Sauvegarde automatiquement en base de donnée. Si c'est un nouvel objet, INSERT, sinon UPDATE
	* @access public
	* @param bool $force force la mis à jour de tous les attributs de l'objet si true, sinon uniquement ceux qui ont été modifiés
	* @return none
	*/
	function sauver($force = false)
	{
		global $db;
		if( $this->id > 0 )
		{
			if(count($this->champs_modif) > 0)
			{
				if($force) $champs = 'type = "'.mysql_escape_string($this->type).'", x = "'.mysql_escape_string($this->x).'", y = "'.mysql_escape_string($this->y).'", royaume = "'.mysql_escape_string($this->royaume).'", debut_placement = "'.mysql_escape_string($this->debut_placement).'", fin_placement = "'.mysql_escape_string($this->fin_placement).'", id_batiment = "'.mysql_escape_string($this->id_batiment).'", hp = "'.mysql_escape_string($this->hp).'", nom = "'.mysql_escape_string($this->nom).'", rez = "'.mysql_escape_string($this->rez).'", point_victoire = "'.mysql_escape_string($this->point_victoire).'"';
				else
				{
					$champs = '';
					foreach($this->champs_modif as $champ)<commit_msg>Garde-fou<commit_after><?php
class placement
{
/**
    * @access private
    * @var int(10)
    */
	private $id;

	/**
    * @access private
    * @var varchar(50)
    */
	private $type;

	/**
    * @access private
    * @var tinyint(3)
    */
	private $x;

	/**
    * @access private
    * @var tinyint(3)
    */
	private $y;

	/**
    * @access private
    * @var tinyint(3)
    */
	private $royaume;

	/**
    * @access private
    * @var int(10)
    */
	private $debut_placement;

	/**
    * @access private
    * @var int(10)
    */
	private $fin_placement;

	/**
    * @access private
    * @var int(10)
    */
	private $id_batiment;

	/**
    * @access private
    * @var int(10)
    */
	private $hp;

	/**
    * @access private
    * @var varchar(50)
    */
	private $nom;

	/**
    * @access private
    * @var int(10)
    */
	private $rez;

	/**
    * @access private
    * @var tinyint(3)
    */
	private $point_victoire;

	
	/**
	* @access public

	* @param int(10) id attribut
	* @param varchar(50) type attribut
	* @param tinyint(3) x attribut
	* @param tinyint(3) y attribut
	* @param tinyint(3) royaume attribut
	* @param int(10) debut_placement attribut
	* @param int(10) fin_placement attribut
	* @param int(10) id_batiment attribut
	* @param int(10) hp attribut
	* @param varchar(50) nom attribut
	* @param int(10) rez attribut
	* @param tinyint(3) point_victoire attribut
	* @return none
	*/
	function __construct($id = 0, $type = '', $x = '', $y = '', $royaume = '', $debut_placement = '', $fin_placement = '', $id_batiment = '', $hp = '', $nom = '', $rez = '', $point_victoire = '')
	{
		global $db;
		//Verification nombre et du type d'argument pour construire l'etat adequat.
		if( (func_num_args() == 1) && is_numeric($id) )
		{
			$requeteSQL = $db->query("SELECT type, x, y, royaume, debut_placement, fin_placement, id_batiment, hp, nom, rez, point_victoire FROM placement WHERE id = ".$id);
			//Si le thread est dans la base, on le charge sinon on crée un thread vide.
			if( $db->num_rows($requeteSQL) > 0 )
			{
				list($this->type, $this->x, $this->y, $this->royaume, $this->debut_placement, $this->fin_placement, $this->id_batiment, $this->hp, $this->nom, $this->rez, $this->point_victoire) = $db->read_array($requeteSQL);
			}
			else $this->__construct();
			$this->id = $id;
		}
		elseif( (func_num_args() == 1) && is_array($id) )
		{
			$this->id = $id['id'];
			$this->type = $id['type'];
			$this->x = $id['x'];
			$this->y = $id['y'];
			$this->royaume = $id['royaume'];
			$this->debut_placement = $id['debut_placement'];
			$this->fin_placement = $id['fin_placement'];
			$this->id_batiment = $id['id_batiment'];
			$this->hp = $id['hp'];
			$this->nom = $id['nom'];
			$this->rez = $id['rez'];
			$this->point_victoire = $id['point_victoire'];
			}
		else
		{
			$this->type = $type;
			$this->x = $x;
			$this->y = $y;
			$this->royaume = $royaume;
			$this->debut_placement = $debut_placement;
			$this->fin_placement = $fin_placement;
			$this->id_batiment = $id_batiment;
			$this->hp = $hp;
			$this->nom = $nom;
			$this->rez = $rez;
			$this->point_victoire = $point_victoire;
			$this->id = $id;
		}
		// Garde-fou
		if ($this->debut_placement == 0) $this->debut_placement = time();
	}

	/**
	* Sauvegarde automatiquement en base de donnée. Si c'est un nouvel objet, INSERT, sinon UPDATE
	* @access public
	* @param bool $force force la mis à jour de tous les attributs de l'objet si true, sinon uniquement ceux qui ont été modifiés
	* @return none
	*/
	function sauver($force = false)
	{
		global $db;
		if( $this->id > 0 )
		{
			if(count($this->champs_modif) > 0)
			{
				if($force) $champs = 'type = "'.mysql_escape_string($this->type).'", x = "'.mysql_escape_string($this->x).'", y = "'.mysql_escape_string($this->y).'", royaume = "'.mysql_escape_string($this->royaume).'", debut_placement = "'.mysql_escape_string($this->debut_placement).'", fin_placement = "'.mysql_escape_string($this->fin_placement).'", id_batiment = "'.mysql_escape_string($this->id_batiment).'", hp = "'.mysql_escape_string($this->hp).'", nom = "'.mysql_escape_string($this->nom).'", rez = "'.mysql_escape_string($this->rez).'", point_victoire = "'.mysql_escape_string($this->point_victoire).'"';
				else
				{
					$champs = '';
					foreach($this->champs_modif as $champ)
{'fraction_non_alphanumeric': 0.19388113937404758, 'fraction_numerical': 0.010901418356581878, 'mean_word_length': 3.309090909090909, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 119, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2940673', 'n_tokens_mistral': 3523, 'n_tokens_neox': 3226, 'n_words': 691}