Skip to content

Commit 218bb1b

Browse files
authored
Merge pull request #678 from DannyvdSluijs/Add-deprecations-on-incorrect-class-names
Add deprecations on incorrect class names
2 parents 7eee107 + b3e3aa5 commit 218bb1b

14 files changed

+192
-627
lines changed

src/Picqer/Financials/Exact/Deleted.php

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,18 @@
22

33
namespace Picqer\Financials\Exact;
44

5+
trigger_error(
6+
sprintf(
7+
'"%s" is deprecated due to an invalid naming convention, use "%s" instead',
8+
Deleted::class,
9+
SyncDeleted::class
10+
),
11+
E_USER_DEPRECATED
12+
);
13+
514
/**
6-
* Class Deleted.
7-
*
8-
* @see https://start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=SyncDeleted
9-
*
10-
* @property int $Timestamp Timestamp
11-
* @property string $DeletedBy UserID of person who deleted record
12-
* @property string $DeletedDate Deleted date
13-
* @property int $Division Division code
14-
* @property string $EntityKey Entity key
15-
* @property int $EntityType Entity Types: 1= TransactionLines 2= Accounts 3= Addresses 4= Attachments 5= Contacts 6= Documents 7= GLAccounts 8= SalesItemPrices 9= Items 10= PaymentTerms 11= Quotations 12= SalesOrders 13= SalesInvoices 14= TimeCostTransactions 15= StockPositions 16= GoodsDeliveries 17= GoodsDeliveryLines 18= GLClassifications 19= ItemWarehouses 20= StorageLocationStockPositions 21= Projects
16-
* @property string $ID Primary key
15+
* @deprecated since 4.5.2, use \Picqer\Financials\Exact\SyncDeleted instead, to be removed in 5.0
1716
*/
18-
class Deleted extends Model
17+
class Deleted extends SyncDeleted
1918
{
20-
use Query\Findable;
21-
22-
protected $primaryKey = 'Timestamp';
23-
24-
protected $fillable = [
25-
'Timestamp',
26-
'DeletedBy',
27-
'DeletedDate',
28-
'Division',
29-
'EntityKey',
30-
'EntityType',
31-
'ID',
32-
];
33-
34-
protected $url = 'sync/Deleted';
3519
}

src/Picqer/Financials/Exact/DocumentCategorie.php

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,18 @@
22

33
namespace Picqer\Financials\Exact;
44

5+
trigger_error(
6+
sprintf(
7+
'"%s" is deprecated due to an invalid naming convention, use "%s" instead',
8+
DocumentCategorie::class,
9+
DocumentCategory::class
10+
),
11+
E_USER_DEPRECATED
12+
);
13+
514
/**
6-
* Class DocumentCategorie.
7-
*
8-
* @see https://start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=DocumentsDocumentCategories
9-
*
10-
* @property string $ID Primary key
11-
* @property string $Created Creation date
12-
* @property string $Description Document category description
13-
* @property string $Modified Last modified date
15+
* @deprecated since 4.5.2, use \Picqer\Financials\Exact\DocumentCategory instead, to be removed in 5.0
1416
*/
15-
class DocumentCategorie extends Model
17+
class DocumentCategorie extends DocumentCategory
1618
{
17-
use Query\Findable;
18-
use Persistance\Storable;
19-
20-
protected $fillable = [
21-
'ID',
22-
'Created',
23-
'Description',
24-
'Modified',
25-
];
26-
27-
protected $url = 'documents/DocumentCategories';
2819
}

src/Picqer/Financials/Exact/DocumentsAttachment.php

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,18 @@
22

33
namespace Picqer\Financials\Exact;
44

5+
trigger_error(
6+
sprintf(
7+
'"%s" is deprecated due to an invalid naming convention, use "%s" instead',
8+
DocumentsAttachment::class,
9+
CrmDocumentAttachment::class
10+
),
11+
E_USER_DEPRECATED
12+
);
13+
514
/**
6-
* Class DocumentsAttachment.
7-
*
8-
* @see https://start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=ReadCRMDocumentsAttachments
9-
*
10-
* @property string $ID Primary key
11-
* @property string $AttachmentFileName Filename of the attachment
12-
* @property float $AttachmentFileSize File size of the attachment
13-
* @property string $AttachmentUrl Url for downloading the attachment. To get the file in its original format (xml, jpg, pdf, etc.) append &Download=1 to the url.
14-
* @property bool $CanShowInWebView
15+
* @deprecated since 4.5.2, use \Picqer\Financials\Exact\CrmDocumentAttachment instead, to be removed in 5.0
1516
*/
16-
class DocumentsAttachment extends Model
17+
class DocumentsAttachment extends CrmDocumentAttachment
1718
{
18-
use Query\Findable;
19-
20-
protected $fillable = [
21-
'ID',
22-
'AttachmentFileName',
23-
'AttachmentFileSize',
24-
'AttachmentUrl',
25-
'CanShowInWebView',
26-
];
27-
28-
protected $url = 'read/crm/DocumentsAttachments';
2919
}

src/Picqer/Financials/Exact/HrmDivision.php

Lines changed: 11 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -2,86 +2,18 @@
22

33
namespace Picqer\Financials\Exact;
44

5+
trigger_error(
6+
sprintf(
7+
'"%s" is deprecated due to an invalid naming convention, use "%s" instead',
8+
HrmDivision::class,
9+
Division::class
10+
),
11+
E_USER_DEPRECATED
12+
);
13+
514
/**
6-
* Class HrmDivision.
7-
*
8-
* @see https://start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=HRMDivisions
9-
*
10-
* @property int $Code Primary key
11-
* @property string $ArchiveDate Date on which the division is archived
12-
* @property int $BlockingStatus Values: 0 = Not blocked, 1 = Backup/restore, 2 = Conversion busy, 3 = Conversion shadow, 4 = Conversion waiting, 5 = Copy data waiting, 6 = Copy data busy
13-
* @property DivisionClass[] $Class_01 First division classification. User should have access rights to view division classifications.
14-
* @property DivisionClass[] $Class_02 Second division classification. User should have access rights to view division classifications.
15-
* @property DivisionClass[] $Class_03 Third division classification. User should have access rights to view division classifications.
16-
* @property DivisionClass[] $Class_04 Fourth division classification. User should have access rights to view division classifications.
17-
* @property DivisionClass[] $Class_05 Fifth division classification. User should have access rights to view division classifications.
18-
* @property string $Country Country of the division. Is used for determination of legislation
19-
* @property string $CountryDescription Description of Country
20-
* @property string $Created Creation date
21-
* @property string $Creator User ID of creator
22-
* @property string $CreatorFullName Name of the creator
23-
* @property string $Currency Default currency of the division
24-
* @property string $CurrencyDescription Description of Currency
25-
* @property string $Customer Owner account of the division
26-
* @property string $CustomerCode Owner account code of the division
27-
* @property string $CustomerName Owner account name of the division
28-
* @property string $Description Description
29-
* @property int $HID Number that customers give to the division
30-
* @property bool $Main True for the main (hosting) division
31-
* @property string $Modified Last modified date
32-
* @property string $Modifier User ID of modifier
33-
* @property string $ModifierFullName Name of the last modifier
34-
* @property string $OBNumber The soletrader VAT number used for offical returns to tax authority
35-
* @property string $SiretNumber Siret Number of the division (France)
36-
* @property string $StartDate Date on which the division becomes active
37-
* @property int $Status Regular administrations will have status 0. Currently, the only other possibility is 'archived' (1), which means the administration is not actively used, but still needs to be accessible for the customer/accountant to meet legal obligations
38-
* @property string $TaxOfficeNumber Number of your local tax authority (Germany)
39-
* @property string $TaxReferenceNumber Local tax reference number (Germany)
40-
* @property string $TemplateCode Division template code
41-
* @property string $VATNumber VAT number
42-
* @property string $Website Customer value, hyperlink to external website
15+
* @deprecated since 4.5.2, use \Picqer\Financials\Exact\Division instead, to be removed in 5.0
4316
*/
44-
class HrmDivision extends Model
17+
class HrmDivision extends Division
4518
{
46-
use Query\Findable;
47-
48-
protected $primaryKey = 'Code';
49-
50-
protected $fillable = [
51-
'Code',
52-
'ArchiveDate',
53-
'BlockingStatus',
54-
'Class_01',
55-
'Class_02',
56-
'Class_03',
57-
'Class_04',
58-
'Class_05',
59-
'Country',
60-
'CountryDescription',
61-
'Created',
62-
'Creator',
63-
'CreatorFullName',
64-
'Currency',
65-
'CurrencyDescription',
66-
'Customer',
67-
'CustomerCode',
68-
'CustomerName',
69-
'Description',
70-
'HID',
71-
'Main',
72-
'Modified',
73-
'Modifier',
74-
'ModifierFullName',
75-
'OBNumber',
76-
'SiretNumber',
77-
'StartDate',
78-
'Status',
79-
'TaxOfficeNumber',
80-
'TaxReferenceNumber',
81-
'TemplateCode',
82-
'VATNumber',
83-
'Website',
84-
];
85-
86-
protected $url = 'hrm/Divisions';
8719
}

src/Picqer/Financials/Exact/InventoryItemWarehouse.php

Lines changed: 11 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -2,72 +2,18 @@
22

33
namespace Picqer\Financials\Exact;
44

5+
trigger_error(
6+
sprintf(
7+
'"%s" is deprecated due to an invalid naming convention, use "%s" instead',
8+
InventoryItemWarehouse::class,
9+
SyncInventoryItemWarehouse::class
10+
),
11+
E_USER_DEPRECATED
12+
);
13+
514
/**
6-
* Class InventoryItemWarehouse.
7-
*
8-
* @see https://start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=SyncInventoryItemWarehouses
9-
*
10-
* @property int $Timestamp Timestamp
11-
* @property string $Created Creation date
12-
* @property string $Creator User ID of creator
13-
* @property string $CreatorFullName Name of creator
14-
* @property string $DefaultStorageLocation This is a default storage location
15-
* @property string $DefaultStorageLocationCode Default storage location's code
16-
* @property string $DefaultStorageLocationDescription Default storage location's description
17-
* @property int $Division Division code
18-
* @property string $ID A guid that is the unique identifier of the linkage between item and warehouse
19-
* @property string $Item Item ID
20-
* @property string $ItemCode Code of item
21-
* @property string $ItemDescription Description of item
22-
* @property float $MaximumStock Maximum quantity of items that you want in warehouse
23-
* @property string $Modified Last modified date
24-
* @property string $Modifier User ID of modifier
25-
* @property string $ModifierFullName Name of modifier
26-
* @property int $OrderPolicy Order Policy options: 1-Lot for lot, 2-Fixed order quantity, 3-Min / Max, 4-Order
27-
* @property int $Period Period that work together with replenishment in MRP
28-
* @property float $ReorderPoint Quantity of items as an indication of when you need to reorder more stock for the warehouse
29-
* @property float $ReorderQuantity Reorder quantity that work together with replenishment in MRP
30-
* @property int $ReplenishmentType Replenishment options: 1-Purchase, 2-Assemble, 3-Make, 4-Transfer, 5-No replenishment advice
31-
* @property float $ReservedStock The quantity in a back to back order process which is already received from the purchase order, but not yet delivered for the sales order.
32-
* @property float $SafetyStock Minimum quantity of items you must have in stock
33-
* @property string $Warehouse Warehouse ID
34-
* @property string $WarehouseCode Code of warehouse
35-
* @property string $WarehouseDescription Description of warehouse
15+
* @deprecated since 4.5.2, use \Picqer\Financials\Exact\SyncInventoryItemWarehouse instead, to be removed in 5.0
3616
*/
37-
class InventoryItemWarehouse extends Model
17+
class InventoryItemWarehouse extends SyncInventoryItemWarehouse
3818
{
39-
use Query\Findable;
40-
41-
protected $primaryKey = 'Timestamp';
42-
43-
protected $fillable = [
44-
'Timestamp',
45-
'Created',
46-
'Creator',
47-
'CreatorFullName',
48-
'DefaultStorageLocation',
49-
'DefaultStorageLocationCode',
50-
'DefaultStorageLocationDescription',
51-
'Division',
52-
'ID',
53-
'Item',
54-
'ItemCode',
55-
'ItemDescription',
56-
'MaximumStock',
57-
'Modified',
58-
'Modifier',
59-
'ModifierFullName',
60-
'OrderPolicy',
61-
'Period',
62-
'ReorderPoint',
63-
'ReorderQuantity',
64-
'ReplenishmentType',
65-
'ReservedStock',
66-
'SafetyStock',
67-
'Warehouse',
68-
'WarehouseCode',
69-
'WarehouseDescription',
70-
];
71-
72-
protected $url = 'sync/Inventory/ItemWarehouses';
7319
}

src/Picqer/Financials/Exact/ItemWarehousePlanningDetails.php

Lines changed: 11 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,18 @@
22

33
namespace Picqer\Financials\Exact;
44

5+
trigger_error(
6+
sprintf(
7+
'"%s" is deprecated due to an invalid naming convention, use "%s" instead',
8+
ItemWarehousePlanningDetails::class,
9+
ItemWarehousePlanningDetail::class
10+
),
11+
E_USER_DEPRECATED
12+
);
13+
514
/**
6-
* Class ItemWarehousePlanningDetails.
7-
*
8-
* @see https://start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=InventoryItemWarehousePlanningDetails
9-
*
10-
* @property string $Item Primary key
11-
* @property string $ItemCode Code of item
12-
* @property string $ItemDescription Description of item
13-
* @property string $PlannedDate Date which quantity in stock is planned to change
14-
* @property float $PlannedQuantity Amount by which quantity in stock is planned to change
15-
* @property string $PlanningSourceDescription Human readable description of the PlanningSource (translated to user's language) - Examples: Purchase Order, Sales Order, Shop Order, etc.
16-
* @property string $PlanningSourceID ID of the PlanningSource
17-
* @property int $PlanningSourceLineNumber Line number of the PlanningSource if the PlanningSourceType supports line numbers
18-
* @property int $PlanningSourceNumber Human readable number of the PlanningSource - Examples: Shop order number '201600001' or Sales order number '2016020001'
19-
* @property string $PlanningSourceUrl REST API URL of this specific PlanningSource and PlanningSourceID (Assembly orders and warehouse transfers not supported over REST)
20-
* @property int $PlanningType Type of the PlanningSource - 120=GoodsDelivery, 124=WarehouseTransferDelivery, 130=GoodsReceipt, 134=WarehouseTransferReceipt, 140=ShopOrderStockReceipt, 147=ShopOrderByProductReceipt, 150=ShopOrderRequirement, 160=AssemblyOrderReceipt, 165=AssemblyOrderIssue
21-
* @property string $PlanningTypeDescription Human readable description of the PlanningSourceType (translated to user's language) - Examples: 'Shop order stock receipt' or 'Goods delivery'
22-
* @property string $Warehouse ID of warehouse
23-
* @property string $WarehouseCode Code of warehouse
24-
* @property string $WarehouseDescription Description of warehouse
15+
* @deprecated since 4.5.2, use \Picqer\Financials\Exact\ItemWarehousePlanningDetail instead, to be removed in 5.0
2516
*/
26-
class ItemWarehousePlanningDetails extends Model
17+
class ItemWarehousePlanningDetails extends ItemWarehousePlanningDetail
2718
{
28-
use Query\Findable;
29-
use Persistance\Storable;
30-
31-
protected $fillable = [
32-
'Item',
33-
'ItemCode',
34-
'ItemDescription',
35-
'PlannedDate',
36-
'PlannedQuantity',
37-
'PlanningSourceDescription',
38-
'PlanningSourceID',
39-
'PlanningSourceLineNumber',
40-
'PlanningSourceUrl',
41-
'PlanningType',
42-
'PlanningTypeDescription',
43-
'Warehouse',
44-
'WarehouseCode',
45-
'WarehouseDescription',
46-
];
47-
48-
protected $url = 'inventory/ItemWarehousePlanningDetails';
4919
}

0 commit comments

Comments
 (0)