Completed
Push — master ( 2e26b5...b4f6b0 )
by Sören
02:18
created

AbstractWishlistManager::createWishlist()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
/*
4
 * (c) Soeren Martius
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace SoerenMartius\Component\Wishlist\Manager;
11
12
use SoerenMartius\Component\Wishlist\Model\WishlistInterface;
13
14
/**
15
 * @author Soeren Martius <[email protected]>
16
 */
17
abstract class AbstractWishlistManager implements
18
    WishlistManagerInterface,
19
    ManagerInterface
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24
    public function findWishlistById($id)
25
    {
26
        return $this->findWishlistBy(['id' => $id]);
27
    }
28
29
    /**
30
     * {@inheritdoc}
31
     */
32
    public function findWishlistBySharingCode(string $sharingCode)
33
    {
34
        return $this->findWishlistBy(['sharingCode' => $sharingCode]);
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40
    public function createWishlist(): WishlistInterface
41
    {
42
        $class = $this->getClass();
43
        $wishlist = new $class();
44
45
        return $wishlist;
46
    }
47
}
48