Skip to content

Commit 741c5c4

Browse files
committed
fix: Deprecate Units in favour of Unit
reviewing the code base using some exploratory testing, duplication between Units and Unit was discovered and verified to be a duplicate
1 parent caeb3d7 commit 741c5c4

File tree

1 file changed

+11
-27
lines changed

1 file changed

+11
-27
lines changed

src/Picqer/Financials/Exact/Units.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+
Units::class,
9+
Unit::class
10+
),
11+
E_USER_DEPRECATED
12+
);
13+
514
/**
6-
* Class Units.
7-
*
8-
* @see https://start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=LogisticsUnits
9-
*
10-
* @property string $ID Primary key
11-
* @property bool $Active Indicates whether a unit is in use
12-
* @property string $Code Unique code for the unit
13-
* @property string $Description Description
14-
* @property int $Division Division code
15-
* @property int $Main Indicates the main unit per division. Will be used when creating new item
16-
* @property string $TimeUnit If Type = 'T' (time) then this fields indicates the type of time frame. yy = Year, mm = Month, wk = Week, dd = Day, hh = Hour, mi = Minute, ss = Second
17-
* @property string $Type Type 'Time' is especially important for contracts.
15+
* @deprecated since 4.5.0, use \Picqer\Financials\Exact\Unit instead, to be removed in 5.0
1816
*/
19-
class Units extends Model
17+
class Units extends Unit
2018
{
21-
use Query\Findable;
22-
23-
protected $fillable = [
24-
'ID',
25-
'Active',
26-
'Code',
27-
'Description',
28-
'Division',
29-
'Main',
30-
'TimeUnit',
31-
'Type',
32-
];
33-
34-
protected $url = 'logistics/Units';
3519
}

0 commit comments

Comments
 (0)