Skip to content

Commit

Permalink
Layouts resource
Browse files Browse the repository at this point in the history
  • Loading branch information
kg-bot committed Jan 24, 2020
1 parent 41ad807 commit 1c399a3
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
12 changes: 12 additions & 0 deletions src/Builders/LayoutBuilder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace Rackbeat\Builders;


use Rackbeat\Models\Layout;

class LayoutBuilder extends Builder
{
protected $entity = 'layouts';
protected $model = Layout::class;
}
12 changes: 12 additions & 0 deletions src/Models/Layout.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace Rackbeat\Models;


use Rackbeat\Utils\Model;

class Layout extends Model
{
protected $entity = 'layouts';
protected $primaryKey = 'number';
}
15 changes: 12 additions & 3 deletions src/Rackbeat.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Rackbeat\Builders\FieldBuilder;
use Rackbeat\Builders\InventoryAdjustmentBuilder;
use Rackbeat\Builders\InventoryMovementBuilder;
use Rackbeat\Builders\LayoutBuilder;
use Rackbeat\Builders\LocationBuilder;
use Rackbeat\Builders\LotBuilder;
use Rackbeat\Builders\OrderBuilder;
Expand Down Expand Up @@ -232,22 +233,30 @@ public function user_account_plugins()
*/
public function order_shipments()
{
return new OrderShipmentBuilder( $this->request );
return new OrderShipmentBuilder($this->request);
}

/**
* @return \Rackbeat\Builders\FieldBuilder
*/
public function fields()
{
return new FieldBuilder( $this->request );
return new FieldBuilder($this->request);
}

/**
* @return LayoutBuilder
*/
public function layouts()
{
return new LayoutBuilder($this->request);
}

/**
* @return mixed
*/
public function self()
{
return json_decode( (string) $this->request->client->get( 'self' )->getBody() );
return json_decode((string)$this->request->client->get('self')->getBody());
}
}

0 comments on commit 1c399a3

Please sign in to comment.