Sfoglia il codice sorgente

Indentation + commentaires modèle Facture

refactoring
parent
commit
16bec63152
1 ha cambiato i file con 21 aggiunte e 6 eliminazioni
  1. +21
    -6
      common/models/Facture.php

+ 21
- 6
common/models/Facture.php Vedi File

@@ -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();

Loading…
Annulla
Salva