You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 satır
1.7KB

  1. <?php
  2. namespace common\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "developpement".
  6. *
  7. * @property integer $id
  8. * @property string $objet
  9. * @property string $description
  10. * @property string $date
  11. * @property integer $avancement
  12. * @property string $statut
  13. * @property double $estimation_temps
  14. */
  15. class Developpement extends \yii\db\ActiveRecord {
  16. const STATUT_OPEN = 'open' ;
  17. const STATUT_CLOSED = 'closed' ;
  18. const TYPE_EVOLUTION = 'evolution' ;
  19. const TYPE_BUG = 'bug' ;
  20. /**
  21. * @inheritdoc
  22. */
  23. public static function tableName() {
  24. return 'developpement';
  25. }
  26. /**
  27. * @inheritdoc
  28. */
  29. public function rules() {
  30. return [
  31. [['objet', 'date'], 'required'],
  32. [['id', 'avancement'], 'integer'],
  33. [['description'], 'string'],
  34. [['date','date_livraison'], 'safe'],
  35. [['estimation_temps'], 'number'],
  36. [['objet', 'statut','type'], 'string', 'max' => 255],
  37. ];
  38. }
  39. /**
  40. * @inheritdoc
  41. */
  42. public function attributeLabels() {
  43. return [
  44. 'id' => 'ID',
  45. 'objet' => 'Sujet',
  46. 'description' => 'Description',
  47. 'date' => 'Date',
  48. 'avancement' => 'Avancement',
  49. 'statut' => 'Statut',
  50. 'estimation_temps' => 'Estimation temps',
  51. 'type' => 'Type',
  52. 'date_livraison' => 'Date de livraison'
  53. ];
  54. }
  55. public function setDateLivraison($date = '') {
  56. if(strlen($date))
  57. $this->date_livraison = $date ;
  58. if(strlen($this->date_livraison))
  59. $this->date_livraison = date('Y-m-d',strtotime($this->date_livraison)) ;
  60. }
  61. }