Skip to content

Commit

Permalink
User account plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
kg-bot committed Feb 23, 2019
1 parent f08dfa2 commit 6e4e0c4
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/Builders/PluginBuilder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
/**
* Created by PhpStorm.
* User: nts
* Date: 31.3.18.
* Time: 15.37
*/

namespace Rackbeat\Builders;


use Rackbeat\Exceptions\MethodNotImplemented;
use Rackbeat\Models\Plugin;

class PluginBuilder extends Builder
{
protected $entity = 'user-account-plugins';
protected $model = Plugin::class;

public function create( $data )
{
throw new MethodNotImplemented();
}
}
16 changes: 16 additions & 0 deletions src/Exceptions/MethodNotImplemented.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
/**
* Created by PhpStorm.
* User: nts
* Date: 31.3.18.
* Time: 16.59
*/

namespace Rackbeat\Exceptions;


class MethodNotImplemented extends \Exception
{

protected $message = 'This method is not implemented on given resource.';
}
30 changes: 30 additions & 0 deletions src/Models/Plugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/**
* Created by PhpStorm.
* User: nts
* Date: 31.3.18.
* Time: 16.48
*/

namespace Rackbeat\Models;


use Rackbeat\Exceptions\MethodNotImplemented;
use Rackbeat\Utils\Model;

class Plugin extends Model
{

protected $entity = 'user-account-plugins';
protected $primaryKey = 'id';

public function delete()
{
throw new MethodNotImplemented();
}

public function update( $data = [] )
{
throw new MethodNotImplemented();
}
}
9 changes: 9 additions & 0 deletions src/Rackbeat.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Rackbeat\Builders\LotBuilder;
use Rackbeat\Builders\OrderBuilder;
use Rackbeat\Builders\PaymentTermBuilder;
use Rackbeat\Builders\PluginBuilder;
use Rackbeat\Builders\ProductBuilder;
use Rackbeat\Builders\ProductGroupBuilder;
use Rackbeat\Builders\ProductionOrderBuilder;
Expand Down Expand Up @@ -203,6 +204,14 @@ public function webhooks()
return new WebhookBuilder( $this->request );
}

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

/**
* @return mixed
*/
Expand Down

0 comments on commit 6e4e0c4

Please sign in to comment.