Kaynağa Gözat

Indentation + commentaires modèle Facture

dev
Guillaume Bourgeois 6 yıl önce
ebeveyn
işleme
16bec63152
1 değiştirilmiş dosya ile 21 ekleme ve 6 silme
  1. +21
    -6
      common/models/Facture.php

+ 21
- 6
common/models/Facture.php Dosyayı Görüntüle

@@ -54,19 +54,22 @@ use Yii;
* @property string $date_paiement
* @property string $methode_paiement
*/
class Facture extends \yii\db\ActiveRecord {
class Facture extends \yii\db\ActiveRecord
{

/**
* @inheritdoc
*/
public static function tableName() {
public static function tableName()
{
return 'facture';
}

/**
* @inheritdoc
*/
public function rules() {
public function rules()
{
return [
[['id_etablissement', 'paye'], 'integer'],
[['date', 'date_paiement'], 'safe'],
@@ -76,14 +79,20 @@ class Facture extends \yii\db\ActiveRecord {
];
}

public function getEtablissement() {
/*
* Relations
*/
public function getEtablissement()
{
return $this->hasOne(Etablissement::className(), ['id' => 'id_etablissement']);
}

/**
* @inheritdoc
*/
public function attributeLabels() {
public function attributeLabels()
{
return [
'id' => 'ID',
'id_etablissement' => 'Id Etablissement',
@@ -99,7 +108,13 @@ class Facture extends \yii\db\ActiveRecord {
];
}

public static function getLastFacture() {
/**
* Retourne la dernière facture émise.
*
* @return Facture
*/
public static function getLastFacture()
{
return Facture::find()
->orderBy('reference DESC')
->one();

Yükleniyor…
İptal
Kaydet