Completed
Pull Request — master (#179)
by
unknown
08:15
created

MarketModels::getAll()   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
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Yandex\Market\Partner\Models;
4
5
use Yandex\Common\ObjectModel;
6
7
class MarketModels extends ObjectModel
8
{
9
    /**
10
     * Add model
11
     *
12
     * @param array|MarketModel $model
13
     * @return $this
14
     */
15
    public function add($model)
16
    {
17
        if (is_array($model)) {
18
            $this->collection[] = new MarketModel($model);
19
        } elseif ($model instanceof MarketModel) {
20
            $this->collection[] = $model;
21
        }
22
23
        return $this;
24
    }
25
26
    /**
27
     * Get models
28
     *
29
     * @return array
30
     */
31
    public function getAll()
32
    {
33
        return $this->collection;
34
    }
35
}
36