Completed
Push — master ( 13bbff...a53018 )
by Gilmar
21:55
created

Manager::getMap()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 1 Features 0
Metric Value
c 3
b 1
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
3
/*
4
 * This file is part of gpupo/netshoes-sdk
5
 * Created by Gilmar Pupo <[email protected]>
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 * For more information, see <http://www.g1mr.com/>.
9
 */
10
namespace Gpupo\NetshoesSdk\Entity\Product;
11
12
use Gpupo\CommonSdk\Entity\EntityInterface;
13
use Gpupo\NetshoesSdk\Entity\ManagerAbstract;
14
15
class Manager extends ManagerAbstract
16
{
17
    protected $entity = 'Product';
18
19
    protected $maps = [
20
        'save'     => ['POST', '/products'],
21
        'findById' => ['GET', '/products/{itemId}'],
22
        'patch'    => ['PATCH', '/products/{itemId}'],
23
        'update'   => ['PUT', '/products/{itemId}'],
24
        'fetch'    => ['GET', '/products?page={offset}&size={limit}'],
25
    ];
26
27
    public function save(EntityInterface $product, $route = 'save')
28
    {
29
        return $this->execute($this->factoryMap('save'), $product->toJson());
30
    }
31
}
32