add changes feature/33

This commit is contained in:
2015-09-24 10:06:10 +02:00
parent 1eae1b3000
commit fcc18d79f6
14 changed files with 621 additions and 2 deletions

View File

@@ -108,4 +108,21 @@ class Account extends \yii\db\ActiveRecord
return $this->status == self::STATUS_DELETED;
}
/**
* $param int $forceIncludeAccount id account, that should be included in list, even if it is inactive
* */
public static function readAccounts($forceIncludeAccount = null){
$accounts = null;
if ( $forceIncludeAccount == null){
$accounts = Account::find()->andWhere(['status' => Account::STATUS_ACTIVE])->all();
}else{
$accounts = Account::find()->andWhere( ['or', ['status' => Account::STATUS_ACTIVE], ['id_account' => $forceIncludeAccount ] ])->all();
}
return $accounts;
}
}