Commit d0b9dae9 authored by Karamel's avatar Karamel
Browse files

Fix some PHP warnings about non static functions and missing getSequence().

parent d094dd96
......@@ -37,7 +37,7 @@ use \Pasteque\Server\System\DAO\DoctrineModel;
class CashSessionCustBalance extends DoctrineModel // Embedded class
{
public function getDirectFieldNames() {
return ['sequence', 'balance'];
return ['balance'];
}
public function getAssociationFields() {
return [
......
......@@ -129,7 +129,7 @@ class CashSessionPayment extends DoctrineModel // Embedded class
$payment = new CashSessionPayment();
$payment->setAmount($struct['amount']);
$payment->setCurrencyAmount($struct['currencyAmount']);
$currencyField = static::getAssociationFields()[2];
$currencyField = $payment->getAssociationFields()[2];
$payment->setCurrency(static::readAssociationValue($struct, $dao, $currencyField));
$search = $dao->search(\Pasteque\Server\Model\PaymentMode::class,
new DAOCondition('reference', '=', $struct['type']));
......
......@@ -138,7 +138,7 @@ class TicketPayment extends DoctrineModel // Embedded class
$payment->setDispOrder($struct['dispOrder']);
$payment->setAmount($struct['amount']);
$payment->setCurrencyAmount($struct['currencyAmount']);
$currencyField = static::getAssociationFields()[2];
$currencyField = $payment->getAssociationFields()[2];
$payment->setCurrency(static::readAssociationValue($struct, $dao, $currencyField));
$search = $dao->search(\Pasteque\Server\Model\PaymentMode::class,
new DAOCondition('reference', '=', $struct['type']));
......
......@@ -165,7 +165,7 @@ abstract class DoctrineModel
public static function fromStruct($struct, $dao, $embedded = false) {
$model = static::instanceFromStruct($struct, $dao, $embedded);
$model->directFieldsFromStruct($struct, $dao);
$associationFields = static::getAssociationFields();
$associationFields = $model->getAssociationFields();
foreach ($associationFields as $field) {
if (!empty($field['internal'])) {
// Internal fields are read from dao in instanceFromStruct
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment