mirror of
https://github.com/ToxicCrack/PrintABrick.git
synced 2025-05-18 21:20:09 -07:00
Add getPartsByLDrawNumber api function
Add function to fetch rebrickable parts related to LDraw model by number
This commit is contained in:
parent
6fb797a124
commit
6421ed66f2
@ -119,6 +119,20 @@ class RebrickableManager
|
||||
return $this->serializer->deserialize($data, PartCategory::class, self::FORMAT);
|
||||
}
|
||||
|
||||
public function getPartsByLDrawNumber($number) {
|
||||
$options = [
|
||||
'query' => [
|
||||
'ldraw_id' => $number
|
||||
],
|
||||
];
|
||||
|
||||
$response = $this->rebrickableClient->call('GET','lego/parts', $options);
|
||||
|
||||
$data = json_decode($response, true)['results'];
|
||||
|
||||
return $this->serializer->denormalize($data,Part::class.'[]',self::FORMAT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of sets that a specific part/color appears in.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user