Skip to content

Commit

Permalink
Add resource for articles
Browse files Browse the repository at this point in the history
  • Loading branch information
KFoobar committed Nov 27, 2023
1 parent 4071661 commit 63c088d
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
Empty file removed src/Resources/Article/.gitkeep
Empty file.
30 changes: 30 additions & 0 deletions src/Resources/Article/Articles.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace KFoobar\Fortnox\Resources\Article;

use KFoobar\Fortnox\Interfaces\ClientInterface;
use KFoobar\Fortnox\Interfaces\ResourceInterface;
use KFoobar\Fortnox\Traits\HasCreate;
use KFoobar\Fortnox\Traits\HasDelete;
use KFoobar\Fortnox\Traits\HasRetrieve;
use KFoobar\Fortnox\Traits\HasUpdate;

class Articles implements ResourceInterface
{
use HasCreate;
use HasDelete;
use HasRetrieve;
use HasUpdate;

protected $endpoint = 'articles';

/**
* Constructs a new instance.
*
* @param \KFoobar\Fortnox\Interfaces\ClientInterface $client
*/
public function __construct(ClientInterface $client)
{
$this->client = $client;
}
}
11 changes: 11 additions & 0 deletions src/Services/Fortnox.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace KFoobar\Fortnox\Services;

use KFoobar\Fortnox\Resources\Account\Accounts;
use KFoobar\Fortnox\Resources\Article\Articles;
use KFoobar\Fortnox\Resources\CostCenter\CostCenters;
use KFoobar\Fortnox\Resources\Currency\Currencies;
use KFoobar\Fortnox\Resources\Customer\Customers;
Expand Down Expand Up @@ -42,6 +43,16 @@ public function accounts()
return new Accounts($this->client);
}

/**
* Returns the articles resource.
*
* @return \KFoobar\Fortnox\Resources\Article\Articles
*/
public function articles()
{
return new Articles($this->client);
}

/**
* Returns the cost centers resource.
*
Expand Down

0 comments on commit 63c088d

Please sign in to comment.