Completed
Push — master ( b8acd8...13d185 )
by Maciej
14:05
created

Post::findByIds()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 2
Metric Value
c 2
b 0
f 2
dl 0
loc 5
rs 9.4285
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/**
3
 * Created by Maciej Paprocki for Bureau-VA.
4
 * Date: 17/02/2016
5
 * Project Name: MaciekPaprocki\WordpressGuzzle
6
 * Time: 12:17
7
 */
8
9
namespace BureauVa\WordpressGuzzle\Repository;
10
11
12
/**
13
 * Class Post
14
 * @package MaciekPaprocki\WordpressGuzzle
15
 */
16
17
class Post extends RepositoryAbstract
18
{
19
    const PATH = 'posts';
20
21
    /**
22
     * finds Multiple posts by array of ids
23
     * @param $id
24
     * @return null
25
     */
26
    public function findByIds($ids)
27
    {
28
29
        return $this->createPromise(self::PATH, ['post__in' => $ids]);
30
    }
31
32
    /**
33
     * finds post by id
34
     * @param $id
35
     * @return null
36
     */
37
    public function findOneById($id)
38
    {
39
40
41
        return $this->createPromise(self::PATH . '/' . $id);
42
    }
43
}