Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pasteque
pasteque-server
Commits
f82e4b38
Commit
f82e4b38
authored
Jan 09, 2020
by
Karamel
Browse files
Make getDirectFieldNames and getAssociationFields protected static.
parent
67a61d16
Changes
34
Hide whitespace changes
Inline
Side-by-side
src/lib/Model/CashRegister.php
View file @
f82e4b38
...
...
@@ -31,10 +31,10 @@ use \Pasteque\Server\System\DAO\DoctrineModel;
*/
class
CashRegister
extends
DoctrineModel
{
protected
function
getDirectFieldNames
()
{
protected
static
function
getDirectFieldNames
()
{
return
[
'id'
,
'reference'
,
'label'
,
'nextTicketId'
,
'nextSessionId'
];
}
protected
function
getAssociationFields
()
{
protected
static
function
getAssociationFields
()
{
return
[
[
'name'
=>
'sessions'
,
...
...
src/lib/Model/CashSession.php
View file @
f82e4b38
...
...
@@ -45,14 +45,14 @@ class CashSession extends DoctrineModel
/** Close type for a fiscal year close. */
const
CLOSE_FYEAR
=
2
;
protected
function
getDirectFieldNames
()
{
protected
static
function
getDirectFieldNames
()
{
return
[
'sequence'
,
'continuous'
,
'openDate'
,
'closeDate'
,
'openCash'
,
'closeCash'
,
'expectedCash'
,
'ticketCount'
,
'custCount'
,
'cs'
,
'csPeriod'
,
'csFYear'
];
// 'closeType' (optional) imported on close but not exported nor stored.
}
protected
function
getAssociationFields
()
{
protected
static
function
getAssociationFields
()
{
return
[
[
'name'
=>
'cashRegister'
,
...
...
src/lib/Model/CashSessionCat.php
View file @
f82e4b38
...
...
@@ -36,11 +36,11 @@ use \Pasteque\Server\System\DAO\DoctrineModel;
*/
class
CashSessionCat
extends
DoctrineModel
// Embedded class
{
p
ubl
ic
function
getDirectFieldNames
()
{
p
rotected
stat
ic
function
getDirectFieldNames
()
{
// Not associative to be able to delete empty categories.
return
[
'reference'
,
'label'
,
'amount'
];
}
p
ubl
ic
function
getAssociationFields
()
{
p
rotected
stat
ic
function
getAssociationFields
()
{
return
[
[
'name'
=>
'cashSession'
,
...
...
src/lib/Model/CashSessionCatTax.php
View file @
f82e4b38
...
...
@@ -36,11 +36,11 @@ use \Pasteque\Server\System\DAO\DoctrineModel;
*/
class
CashSessionCatTax
extends
DoctrineModel
// Embedded class
{
p
ubl
ic
function
getDirectFieldNames
()
{
p
rotected
stat
ic
function
getDirectFieldNames
()
{
// Not associative to be able to delete empty categories.
return
[
'reference'
,
'label'
,
'base'
,
'amount'
];
}
p
ubl
ic
function
getAssociationFields
()
{
p
rotected
stat
ic
function
getAssociationFields
()
{
return
[
[
'name'
=>
'cashSession'
,
...
...
src/lib/Model/CashSessionCustBalance.php
View file @
f82e4b38
...
...
@@ -36,10 +36,10 @@ use \Pasteque\Server\System\DAO\DoctrineModel;
*/
class
CashSessionCustBalance
extends
DoctrineModel
// Embedded class
{
p
ubl
ic
function
getDirectFieldNames
()
{
p
rotected
stat
ic
function
getDirectFieldNames
()
{
return
[
'balance'
];
}
p
ubl
ic
function
getAssociationFields
()
{
p
rotected
stat
ic
function
getAssociationFields
()
{
return
[
[
'name'
=>
'cashSession'
,
...
...
src/lib/Model/CashSessionPayment.php
View file @
f82e4b38
...
...
@@ -35,10 +35,10 @@ use \Pasteque\Server\System\DAO\DoctrineModel;
*/
class
CashSessionPayment
extends
DoctrineModel
// Embedded class
{
p
ubl
ic
function
getDirectFieldNames
()
{
p
rotected
stat
ic
function
getDirectFieldNames
()
{
return
[
'amount'
,
'currencyAmount'
];
}
p
ubl
ic
function
getAssociationFields
()
{
p
rotected
stat
ic
function
getAssociationFields
()
{
return
[
[
'name'
=>
'cashSession'
,
...
...
@@ -135,7 +135,7 @@ class CashSessionPayment extends DoctrineModel // Embedded class
$payment
=
new
CashSessionPayment
();
$payment
->
setAmount
(
$struct
[
'amount'
]);
$payment
->
setCurrencyAmount
(
$struct
[
'currencyAmount'
]);
$currencyField
=
$payment
->
getAssociationFields
()[
2
];
$currencyField
=
static
::
getAssociationFields
()[
2
];
$payment
->
setCurrency
(
$payment
->
readAssociationValue
(
$struct
,
$dao
,
$currencyField
));
$search
=
$dao
->
search
(
\
Pasteque\Server\Model\PaymentMode
::
class
,
new
DAOCondition
(
'reference'
,
'='
,
$struct
[
'type'
]));
...
...
src/lib/Model/CashSessionTax.php
View file @
f82e4b38
...
...
@@ -36,12 +36,12 @@ use \Pasteque\Server\System\DAO\DoctrineModel;
*/
class
CashSessionTax
extends
DoctrineModel
// Embedded class
{
p
ubl
ic
function
getDirectFieldNames
()
{
p
rotected
stat
ic
function
getDirectFieldNames
()
{
return
[
'taxRate'
,
'base'
,
'basePeriod'
,
'baseFYear'
,
'amount'
,
'amountPeriod'
,
'amountFYear'
];
}
p
ubl
ic
function
getAssociationFields
()
{
p
rotected
stat
ic
function
getAssociationFields
()
{
return
[
[
'name'
=>
'cashSession'
,
...
...
src/lib/Model/Category.php
View file @
f82e4b38
...
...
@@ -33,10 +33,10 @@ use \Pasteque\Server\System\DAO\DoctrineModel;
class
Category
extends
DoctrineModel
{
protected
function
getDirectFieldNames
()
{
protected
static
function
getDirectFieldNames
()
{
return
[
'id'
,
'reference'
,
'label'
,
'dispOrder'
,
'hasImage'
];
}
protected
function
getAssociationFields
()
{
protected
static
function
getAssociationFields
()
{
return
[
[
'name'
=>
'parent'
,
...
...
src/lib/Model/CompositionGroup.php
View file @
f82e4b38
...
...
@@ -32,10 +32,10 @@ use \Pasteque\Server\System\DAO\DoctrineModel;
*/
class
CompositionGroup
extends
DoctrineModel
{
protected
function
getDirectFieldNames
()
{
protected
static
function
getDirectFieldNames
()
{
return
[
'id'
,
'label'
,
'dispOrder'
];
}
protected
function
getAssociationFields
()
{
protected
static
function
getAssociationFields
()
{
return
[
[
'name'
=>
'product'
,
...
...
src/lib/Model/CompositionProduct.php
View file @
f82e4b38
...
...
@@ -32,10 +32,10 @@ use \Pasteque\Server\System\DAO\DoctrineModel;
*/
class
CompositionProduct
extends
DoctrineModel
{
protected
function
getDirectFieldNames
()
{
protected
static
function
getDirectFieldNames
()
{
return
[
'dispOrder'
];
}
protected
function
getAssociationFields
()
{
protected
static
function
getAssociationFields
()
{
return
[
[
'name'
=>
'compositionGroup'
,
...
...
src/lib/Model/Currency.php
View file @
f82e4b38
...
...
@@ -33,11 +33,11 @@ use \Pasteque\Server\System\DAO\DoctrineModel;
*/
class
Currency
extends
DoctrineModel
{
p
ubl
ic
function
getDirectFieldNames
()
{
p
rotected
stat
ic
function
getDirectFieldNames
()
{
return
[
'id'
,
'reference'
,
'label'
,
'symbol'
,
'decimalSeparator'
,
'thousandsSeparator'
,
'format'
,
'rate'
,
'main'
,
'visible'
];
}
p
ubl
ic
function
getAssociationFields
()
{
p
rotected
stat
ic
function
getAssociationFields
()
{
return
[];
}
...
...
src/lib/Model/Customer.php
View file @
f82e4b38
...
...
@@ -33,14 +33,14 @@ use \Pasteque\Server\System\DAO\DoctrineModel;
*/
class
Customer
extends
DoctrineModel
{
protected
function
getDirectFieldNames
()
{
protected
static
function
getDirectFieldNames
()
{
return
[
'id'
,
'dispName'
,
'card'
,
'maxDebt'
,
'balance'
,
'firstName'
,
'lastName'
,
'email'
,
'phone1'
,
'phone2'
,
'fax'
,
'addr1'
,
'addr2'
,
'zipCode'
,
'city'
,
'region'
,
'country'
,
'note'
,
'visible'
,
'hasImage'
,
'expireDate'
];
}
protected
function
getAssociationFields
()
{
protected
static
function
getAssociationFields
()
{
return
[
[
'name'
=>
'discountProfile'
,
...
...
src/lib/Model/Discount.php
View file @
f82e4b38
...
...
@@ -34,11 +34,11 @@ use \Pasteque\Server\System\DAO\DoctrineModel;
*/
class
Discount
extends
DoctrineModel
{
protected
function
getDirectFieldNames
()
{
protected
static
function
getDirectFieldNames
()
{
return
[
'id'
,
'label'
,
'startDate'
,
'endDate'
,
'rate'
,
'barcode'
,
'barcodeType'
,
'dispOrder'
];
}
protected
function
getAssociationFields
()
{
protected
static
function
getAssociationFields
()
{
return
[];
}
...
...
src/lib/Model/DiscountProfile.php
View file @
f82e4b38
...
...
@@ -32,10 +32,10 @@ use \Pasteque\Server\System\DAO\DoctrineModel;
*/
class
DiscountProfile
extends
DoctrineModel
{
protected
function
getDirectFieldNames
()
{
protected
static
function
getDirectFieldNames
()
{
return
[
'id'
,
'label'
,
'rate'
];
}
protected
function
getAssociationFields
()
{
protected
static
function
getAssociationFields
()
{
return
[];
}
...
...
src/lib/Model/FiscalTicket.php
View file @
f82e4b38
...
...
@@ -37,10 +37,10 @@ class FiscalTicket extends DoctrineModel
const
TYPE_ZTICKET
=
'z'
;
const
TYPE_TICKET
=
'tkt'
;
protected
function
getDirectFieldNames
()
{
protected
static
function
getDirectFieldNames
()
{
return
[
'type'
,
'sequence'
,
'number'
,
'date'
,
'content'
,
'signature'
];
}
protected
function
getAssociationFields
()
{
protected
static
function
getAssociationFields
()
{
return
[];
// Must be empty, FiscalTickets must be self-contained.
}
...
...
src/lib/Model/Floor.php
View file @
f82e4b38
...
...
@@ -32,10 +32,10 @@ use \Pasteque\Server\System\DAO\DoctrineModel;
*/
class
Floor
extends
DoctrineModel
{
protected
function
getDirectFieldNames
()
{
protected
static
function
getDirectFieldNames
()
{
return
[
'id'
,
'label'
,
'dispOrder'
];
}
protected
function
getAssociationFields
()
{
protected
static
function
getAssociationFields
()
{
return
[
[
'name'
=>
'places'
,
...
...
src/lib/Model/Image.php
View file @
f82e4b38
...
...
@@ -64,10 +64,10 @@ class Image extends DoctrineModel
}
}
protected
function
getDirectFieldNames
()
{
protected
static
function
getDirectFieldNames
()
{
return
[
'model'
,
'modelId'
,
'mimeType'
,
'image'
];
}
protected
function
getAssociationFields
()
{
protected
static
function
getAssociationFields
()
{
return
[];
}
...
...
src/lib/Model/Option.php
View file @
f82e4b38
...
...
@@ -33,11 +33,11 @@ use \Pasteque\Server\System\DAO\DoctrineModel;
*/
class
Option
extends
DoctrineModel
{
protected
function
getDirectFieldNames
()
{
protected
static
function
getDirectFieldNames
()
{
// 'key' and 'value' are keywords in mysql and crash Doctrine
return
[
'name'
,
'system'
,
'mandatory'
,
'content'
];
}
protected
function
getAssociationFields
()
{
protected
static
function
getAssociationFields
()
{
return
[];
}
...
...
src/lib/Model/PaymentMode.php
View file @
f82e4b38
...
...
@@ -47,10 +47,10 @@ class PaymentMode extends DoctrineModel
/** Uses customer's prepaid (includes CUST_ASSIGNED) */
const
CUST_PREPAID
=
5
;
// 4 + PaymentMode::CUST_ASSIGNED;
protected
function
getDirectFieldNames
()
{
protected
static
function
getDirectFieldNames
()
{
return
[
'id'
,
'reference'
,
'label'
,
'backLabel'
,
'type'
,
'visible'
,
'dispOrder'
,
'hasImage'
];
}
protected
function
getAssociationFields
()
{
protected
static
function
getAssociationFields
()
{
return
[
[
'name'
=>
'values'
,
...
...
src/lib/Model/PaymentModeReturn.php
View file @
f82e4b38
...
...
@@ -33,10 +33,10 @@ use \Pasteque\Server\System\DAO\DoctrineModel;
*/
class
PaymentModeReturn
extends
DoctrineModel
// Embedded class
{
protected
function
getDirectFieldNames
()
{
protected
static
function
getDirectFieldNames
()
{
return
[
'minAmount'
];
}
protected
function
getAssociationFields
()
{
protected
static
function
getAssociationFields
()
{
return
[
[
'name'
=>
'paymentMode'
,
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment