Comment incrémenter un champ automatiquement ?

maherkefi Messages postés 25 Statut Membre -  
maherkefi Messages postés 25 Statut Membre -
j'ai besoin d'aide
j'ai besoin de incrimanters ce champ automatique ce champ chaque jour (+1.8)
c'est possible ou non et merci d'avance
 public $jourconge;
    /**


* @ORM\Column(type="float")     */

EDIT : Ajout des balises de code (la coloration syntaxique).
Explications disponibles ici : ICI

Merci d'y penser dans tes prochains messages.


Merci d'y penser dans tes prochains messages.

1 réponse

  1. jordane45 Messages postés 30427 Date d'inscription   Statut Modérateur Dernière intervention   4 832
     
    Bonjour ( si si.. on commence par ça ici... )

    Tu parles d'un champ.... mais ce n'est que ça déclaration dans une class visiblement que tu nous montres....
    C'est un champ dans une bdd ?
    Car il semble qu'une tâche cron qui lance un script qui fasse ton augmentation soit une solution non ?

    1
    1. maherkefi Messages postés 25 Statut Membre
       
      <?php
      /**
       * Created by PhpStorm.
       * User: USER
       * Date: 18/02/2019
       * Time: 15:40
       */
      namespace CredBundle\Entity;
      use Doctrine\ORM\Mapping As ORM ;
      use Symfony\Bridge\Doctrine\Validator\Constraints as DoctrineAssert;
      use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
      /**
       * class chefequipe
       * @package CredBundle\Entity
       */
      /**
       * @ORM\Entity
       */
      class chefequipe
      {
          /**
           *
           *
           * @ORM\Column(type="integer")
           * @ORM\Id
           *
           */
          public $cin;
          /**
           * @ORM\Column(type="string", length=255)
           */
          public $nom;
          /**
           * @ORM\Column(type="string", length=255)
           */
          public $prenom;
          /**
           * @ORM\Column(type="string", length=255)
           */
          public $fonction;
          /**
           * @ORM\Column(type="integer")
           */
          public $telephone;
          /**
           * @ORM\Column(type="integer")
           */
          public $age;
          /**
           * @ORM\Column(type="float")
           */
          public $jourmaladie;
          /**
           * @ORM\Column(type="float")
           */
          public $jourconge;
          /**
           * @ORM\Column(type="float")
           */
          public $joursup;
          /**
           * @ORM\Column(type="string", length=255, unique=true)
           */
          public $Email;
          /**
           * @ORM\Column(type="integer")
           */
          public $id_hierarchique;
          /**
           * @ORM\OneToMany(targetEntity="chefequipe", mappedBy="Employer")
           */
          public $employer ;
          /**
           * @ORM\OneToMany(targetEntity="Conge", mappedBy="Employer")
           */
      
          public $id_conge ;
          /**
           *
           * @ORM\Column(type="string", length=255)
           */
          public $administration ;
      
          /**
           * @return mixed
           */
          public function getCin()
          {
              return $this->cin;
          }
      
          /**
           * @param mixed $cin
           */
          public function setCin($cin)
          {
              $this->cin = $cin;
          }
      
          /**
           * @return mixed
           */
          public function getNom()
          {
              return $this->nom;
          }
      
          /**
           * @param mixed $nom
           */
          public function setNom($nom)
          {
              $this->nom = $nom;
          }
      
          /**
           * @return mixed
           */
          public function getPrenom()
          {
              return $this->prenom;
          }
      
          /**
           * @param mixed $prenom
           */
          public function setPrenom($prenom)
          {
              $this->prenom = $prenom;
          }
      
          /**
           * @return mixed
           */
          public function getFonction()
          {
              return $this->fonction;
          }
      
          /**
           * @param mixed $fonction
           */
          public function setFonction($fonction)
          {
              $this->fonction = $fonction;
          }
      
          /**
           * @return mixed
           */
          public function getTelephone()
          {
              return $this->telephone;
          }
      
          /**
           * @param mixed $telephone
           */
          public function setTelephone($telephone)
          {
              $this->telephone = $telephone;
          }
      
          /**
           * @return mixed
           */
          public function getAge()
          {
              return $this->age;
          }
      
          /**
           * @param mixed $age
           */
          public function setAge($age)
          {
              $this->age = $age;
          }
      
          /**
           * @return mixed
           */
          public function getJourmaladie()
          {
              return $this->jourmaladie;
          }
      
          /**
           * @param mixed $jourmaladie
           */
          public function setJourmaladie($jourmaladie)
          {
              $this->jourmaladie = $jourmaladie;
          }
      
          /**
           * @return mixed
           */
          public function getJourconge()
          {
              return $this->jourconge;
          }
      
          /**
           * @param mixed $jourconge
           */
          public function setJourconge($jourconge)
          {
              $this->jourconge = $jourconge;
          }
      
          /**
           * @return mixed
           */
          public function getJoursup()
          {
              return $this->joursup;
          }
      
          /**
           * @param mixed $joursup
           */
          public function setJoursup($joursup)
          {
              $this->joursup = $joursup;
          }
      
          /**
           * @return mixed
           */
          public function getEmail()
          {
              return $this->Email;
          }
      
          /**
           * @param mixed $Email
           */
          public function setEmail($Email)
          {
              $this->Email = $Email;
          }
      
          /**
           * @return mixed
           */
          public function getIdHierarchique()
          {
              return $this->id_hierarchique;
          }
      
          /**
           * @param mixed $id_hierarchique
           */
          public function setIdHierarchique($id_hierarchique)
          {
              $this->id_hierarchique = $id_hierarchique;
          }
      
          /**
           * @return mixed
           */
          public function getIdConge()
          {
              return $this->id_conge;
          }
      
          /**
           * @param mixed $id_conge
           */
          public function setIdConge($id_conge)
          {
              $this->id_conge = $id_conge;
          }
      
          /**
           * @return mixed
           */
          public function getAdministration()
          {
              return $this->administration;
          }
      
          /**
           * @param mixed $administration
           */
          public function setAdministration($administration)
          {
              $this->administration = $administration;
          }
      }
      
      0
    2. maherkefi Messages postés 25 Statut Membre
       
      oui dans un base de données
      0
    3. maherkefi Messages postés 25 Statut Membre
       
      le probleme que je veux le système incrémenter
      la valeur jour conge automatique +1,8 chaque jour
      et merci a ton aide
      0
      1. jordane45 Messages postés 30427 Date d'inscription   Statut Modérateur Dernière intervention   4 832 > maherkefi Messages postés 25 Statut Membre
         
        ben ce n'est pas un problème... je t'ai déjà répondu.
        - Une tâche CRON
        - Un script PHP qui effectue un UPDATE en BDD
        0
    4. maherkefi Messages postés 25 Statut Membre
       
      merci à ton aide
      mais il existe un code ecrit dans enity de symfonie ?
      pour augmenter un champ et merci
      0