AbstractRelationalRepository   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 17
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A findBy() 0 5 1
1
<?php
2
3
namespace Guillermoandrae\Highrise\Repositories;
4
5
use Guillermoandrae\Common\CollectionInterface;
6
7
abstract class AbstractRelationalRepository extends AbstractRepository
8
{
9
    /**
10
     * Returns all upcoming tasks assigned to the authenticated user related to
11
     * a person, company, case, or deal.
12
     *
13
     * @param string $name The name of the resource for which tasks should be
14
     *                     returned.
15
     * @param mixed $id The resource ID.
16
     * @param array $filters  The request filters.
17
     * @return CollectionInterface
18
     */
19
    public function findBy(string $name, $id, array $filters = []): CollectionInterface
20
    {
21
        $uri = sprintf('/%s/%s/%s.xml', $name, $id, $this->getName());
22
        $results = $this->getAdapter()->request('GET', $uri, ['query' => $filters]);
23
        return $this->hydrate($results);
24
    }
25
}
26