|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?php
-
- namespace common\models;
-
- use Yii;
-
- /**
- * This is the model class for table "developpement".
- *
- * @property integer $id
- * @property string $objet
- * @property string $description
- * @property string $date
- * @property integer $avancement
- * @property string $statut
- * @property double $estimation_temps
- */
- class Developpement extends \yii\db\ActiveRecord {
-
- const STATUT_OPEN = 'open' ;
- const STATUT_CLOSED = 'closed' ;
-
- const TYPE_EVOLUTION = 'evolution' ;
- const TYPE_BUG = 'bug' ;
-
- /**
- * @inheritdoc
- */
- public static function tableName() {
- return 'developpement';
- }
-
- /**
- * @inheritdoc
- */
- public function rules() {
- return [
- [['objet', 'date'], 'required'],
- [['id', 'avancement'], 'integer'],
- [['description'], 'string'],
- [['date','date_livraison'], 'safe'],
- [['estimation_temps'], 'number'],
- [['objet', 'statut','type'], 'string', 'max' => 255],
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function attributeLabels() {
- return [
- 'id' => 'ID',
- 'objet' => 'Sujet',
- 'description' => 'Description',
- 'date' => 'Date',
- 'avancement' => 'Avancement',
- 'statut' => 'Statut',
- 'estimation_temps' => 'Estimation temps',
- 'type' => 'Type',
- 'date_livraison' => 'Date de livraison'
- ];
- }
-
- public function setDateLivraison($date = '') {
-
- if(strlen($date))
- $this->date_livraison = $date ;
-
- if(strlen($this->date_livraison))
- $this->date_livraison = date('Y-m-d',strtotime($this->date_livraison)) ;
- }
-
- }
|