Completed
Pull Request — development (#546)
by Nick
06:51
created

BlockService::remove()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
3
namespace Oc\Page;
4
5
/**
6
 * Class BlockService
7
 *
8
 * @package Oc\Page
9
 * @author Nick Lubisch <[email protected]>
10
 */
11
class BlockService
12
{
13
    /**
14
     * @var BlockRepository
15
     */
16
    private $blockRepository;
17
18
    /**
19
     * BlockService constructor.
20
     *
21
     * @param BlockRepository $blockRepository
22
     */
23
    public function __construct(BlockRepository $blockRepository)
24
    {
25
        $this->blockRepository = $blockRepository;
26
    }
27
28
    /**
29
     * Fetch by.
30
     *
31
     * @param array $where
32
     *
33
     * @return BlockEntity[]
34
     */
35
    public function fetchBy(array $where = [])
36
    {
37
        return $this->blockRepository->fetchBy($where);
38
    }
39
40
    /**
41
     * Creates a page in the database.
42
     *
43
     * @param BlockEntity $entity
44
     *
45
     * @return BlockEntity
46
     */
47
    public function create(BlockEntity $entity)
48
    {
49
        return $this->blockRepository->create($entity);
50
    }
51
52
    /**
53
     * Update a page in the database.
54
     *
55
     * @param BlockEntity $entity
56
     *
57
     * @return BlockEntity
58
     */
59
    public function update(BlockEntity $entity)
60
    {
61
        return $this->blockRepository->update($entity);
62
    }
63
64
    /**
65
     * Removes a page from the database.
66
     *
67
     * @param BlockEntity $entity
68
     *
69
     * @return BlockEntity
70
     */
71
    public function remove(BlockEntity $entity)
72
    {
73
        return $this->blockRepository->remove($entity);
74
    }
75
}
76