Completed
Push — issue/60 ( d1c6ae...77529b )
by Alex
02:43
created

MongoFeed   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 21
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 4 1
A setId() 0 4 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: alex
5
 * Date: 11/07/15
6
 * Time: 13:35
7
 */
8
9
require __DIR__.DIRECTORY_SEPARATOR.'bootstrap.php';
10
11
$mongo = new MongoClient();
12
13
$db = $mongo->selectDB('feedioTest');
14
15
$collection = $db->selectCollection('feeds');
16
17
class MongoFeed extends \FeedIo\Feed
18
{
19
    public $id;
20
21
    /**
22
     * @return mixed
23
     */
24
    public function getId()
25
    {
26
        return $this->id;
27
    }
28
29
    /**
30
     * @param mixed $id
31
     */
32
    public function setId($id)
33
    {
34
        $this->id = $id;
35
    }
36
37
}
38
39
$feed = new MongoFeed();
40
$feed->setTitle('title test');
41
$feed->setId(24);
42
$collection->save($feed);
43