Completed
Push — master ( ad254d...4dd779 )
by Sergey
03:29
created

Cards::delete()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 10
rs 9.4285
cc 1
eloc 7
nc 1
nop 2
1
<?php
2
3
namespace seregazhuk\Favro\Api\Endpoints;
4
5
use seregazhuk\Favro\Api\Endpoints\Traits\CrudEndpoint;
6
use seregazhuk\Favro\Api\Endpoints\Traits\BelongsToOrganization;
7
8
class Cards extends Endpoint
9
{
10
11
    use BelongsToOrganization, CrudEndpoint;
12
13
    /**
14
     * @var string
15
     */
16
    protected $endpoint = 'cards';
17
18
    /**
19
     * @param string $widgetCommonId
20
     * @return mixed
21
     */
22
    public function getAll($widgetCommonId)
23
    {
24
        return parent::getAll(['widgetCommonId'=>$widgetCommonId]);
25
    }
26
27
    /**
28
     * @param string $cardId
29
     * @param bool $everywhere
30
     * @return mixed
31
     */
32
    public function delete($cardId, $everywhere)
33
    {
34
        return $this
35
            ->getHttp()
36
            ->delete(
37
                $this->makeRequestUrl($cardId),
38
                ['everywhere' => $everywhere],
39
                $this->getHeaders()
40
            );
41
    }
42
}