Code Duplication    Length = 29-40 lines in 23 locations

src/Yandex/DataSync/Models/Databases.php 1 location

@@ 19-58 (lines=40) @@
16
 * @package  Yandex\DataSync\Models
17
 * @author   Alexander Khaylo <[email protected]>
18
 */
19
class Databases extends ObjectModel
20
{
21
    protected $collection = [];
22
23
    protected $mappingClasses = [];
24
25
    protected $propNameMap = [];
26
27
    /**
28
     * @return Database
29
     */
30
    public function current()
31
    {
32
        return parent::current();
33
    }
34
35
    /**
36
     * @param $items
37
     *
38
     * @return $this
39
     */
40
    public function add($items)
41
    {
42
        if (is_array($items)) {
43
            $this->collection[] = new Database($items);
44
        } elseif (is_object($items) && $items instanceof Database) {
45
            $this->collection[] = $items;
46
        }
47
48
        return $this;
49
    }
50
51
    /**
52
     * @return Database[]
53
     */
54
    public function getAll()
55
    {
56
        return $this->collection;
57
    }
58
}
59

src/Yandex/Market/Partner/Models/Campaigns.php 1 location

@@ 7-37 (lines=31) @@
4
5
use Yandex\Common\ObjectModel;
6
7
class Campaigns extends ObjectModel
8
{
9
10
    protected $collection = [];
11
12
    protected $mappingClasses = [];
13
14
    protected $propNameMap = [];
15
16
    /**
17
     * Add item
18
     */
19
    public function add($campaign)
20
    {
21
        if (is_array($campaign)) {
22
            $this->collection[] = new Campaign($campaign);
23
        } elseif (is_object($campaign) && $campaign instanceof Campaign) {
24
            $this->collection[] = $campaign;
25
        }
26
27
        return $this;
28
    }
29
30
    /**
31
     * Get items
32
     */
33
    public function getAll()
34
    {
35
        return $this->collection;
36
    }
37
}
38

src/Yandex/Market/Partner/Models/DeliveryOptions.php 1 location

@@ 7-37 (lines=31) @@
4
5
use Yandex\Common\ObjectModel;
6
7
class DeliveryOptions extends ObjectModel
8
{
9
10
    protected $collection = [];
11
12
    protected $mappingClasses = [];
13
14
    protected $propNameMap = [];
15
16
    /**
17
     * Add item
18
     */
19
    public function add($deliveryOption)
20
    {
21
        if (is_array($deliveryOption)) {
22
            $this->collection[] = new DeliveryOption($deliveryOption);
23
        } elseif (is_object($deliveryOption) && $deliveryOption instanceof DeliveryOption) {
24
            $this->collection[] = $deliveryOption;
25
        }
26
27
        return $this;
28
    }
29
30
    /**
31
     * Get items
32
     */
33
    public function getAll()
34
    {
35
        return $this->collection;
36
    }
37
}
38

src/Yandex/Market/Partner/Models/DeliveryRules.php 1 location

@@ 7-37 (lines=31) @@
4
5
use Yandex\Common\ObjectModel;
6
7
class DeliveryRules extends ObjectModel
8
{
9
10
    protected $collection = [];
11
12
    protected $mappingClasses = [];
13
14
    protected $propNameMap = [];
15
16
    /**
17
     * Add item
18
     */
19
    public function add($deliveryRule)
20
    {
21
        if (is_array($deliveryRule)) {
22
            $this->collection[] = new DeliveryRule($deliveryRule);
23
        } elseif (is_object($deliveryRule) && $deliveryRule instanceof DeliveryRule) {
24
            $this->collection[] = $deliveryRule;
25
        }
26
27
        return $this;
28
    }
29
30
    /**
31
     * Get items
32
     */
33
    public function getAll()
34
    {
35
        return $this->collection;
36
    }
37
}
38

src/Yandex/Market/Partner/Models/Items.php 1 location

@@ 7-37 (lines=31) @@
4
5
use Yandex\Common\ObjectModel;
6
7
class Items extends ObjectModel
8
{
9
10
    protected $collection = [];
11
12
    protected $mappingClasses = [];
13
14
    protected $propNameMap = [];
15
16
    /**
17
     * Add item
18
     */
19
    public function add($item)
20
    {
21
        if (is_array($item)) {
22
            $this->collection[] = new Item($item);
23
        } elseif (is_object($item) && $item instanceof Item) {
24
            $this->collection[] = $item;
25
        }
26
27
        return $this;
28
    }
29
30
    /**
31
     * Get items
32
     */
33
    public function getAll()
34
    {
35
        return $this->collection;
36
    }
37
}
38

src/Yandex/Market/Partner/Models/Orders.php 1 location

@@ 7-37 (lines=31) @@
4
5
use Yandex\Common\ObjectModel;
6
7
class Orders extends ObjectModel
8
{
9
10
    protected $collection = [];
11
12
    protected $mappingClasses = [];
13
14
    protected $propNameMap = [];
15
16
    /**
17
     * Add item
18
     */
19
    public function add($order)
20
    {
21
        if (is_array($order)) {
22
            $this->collection[] = new Order($order);
23
        } elseif (is_object($order) && $order instanceof Order) {
24
            $this->collection[] = $order;
25
        }
26
27
        return $this;
28
    }
29
30
    /**
31
     * Get items
32
     */
33
    public function getAll()
34
    {
35
        return $this->collection;
36
    }
37
}
38

src/Yandex/Market/Partner/Models/Outlets.php 1 location

@@ 7-37 (lines=31) @@
4
5
use Yandex\Common\ObjectModel;
6
7
class Outlets extends ObjectModel
8
{
9
10
    protected $collection = [];
11
12
    protected $mappingClasses = [];
13
14
    protected $propNameMap = [];
15
16
    /**
17
     * Add item
18
     */
19
    public function add($outlet)
20
    {
21
        if (is_array($outlet)) {
22
            $this->collection[] = new Outlet($outlet);
23
        } elseif (is_object($outlet) && $outlet instanceof Outlet) {
24
            $this->collection[] = $outlet;
25
        }
26
27
        return $this;
28
    }
29
30
    /**
31
     * Get items
32
     */
33
    public function getAll()
34
    {
35
        return $this->collection;
36
    }
37
}
38

src/Yandex/Market/Partner/Models/StateReasons.php 1 location

@@ 7-37 (lines=31) @@
4
5
use Yandex\Common\ObjectModel;
6
7
class StateReasons extends ObjectModel
8
{
9
10
    protected $collection = [];
11
12
    protected $mappingClasses = [];
13
14
    protected $propNameMap = [];
15
16
    /**
17
     * Add item
18
     */
19
    public function add($stateReason)
20
    {
21
        if (is_array($stateReason)) {
22
            $this->collection[] = new StateReason($stateReason);
23
        } elseif (is_object($stateReason) && $stateReason instanceof StateReason) {
24
            $this->collection[] = $stateReason;
25
        }
26
27
        return $this;
28
    }
29
30
    /**
31
     * Get items
32
     */
33
    public function getAll()
34
    {
35
        return $this->collection;
36
    }
37
}
38

src/Yandex/Market/Partner/Models/Stats.php 1 location

@@ 6-34 (lines=29) @@
3
4
use Yandex\Common\ObjectModel;
5
6
class Stats extends ObjectModel
7
{
8
    protected $collection = [];
9
10
    protected $mappingClasses = [];
11
12
    protected $propNameMap = [];
13
14
    /**
15
     * Add item
16
     */
17
    public function add($stat)
18
    {
19
        if (is_array($stat)) {
20
            $this->collection[] = new Stat($stat);
21
        } elseif (is_object($stat) && $stat instanceof Stat) {
22
            $this->collection[] = $stat;
23
        }
24
        return $this;
25
    }
26
27
    /**
28
     * Get items
29
     */
30
    public function getAll()
31
    {
32
        return $this->collection;
33
    }
34
}
35

src/Yandex/Metrica/Analytics/Models/ColumnHeaders.php 1 location

@@ 7-37 (lines=31) @@
4
5
use Yandex\Common\ObjectModel;
6
7
class ColumnHeaders extends ObjectModel
8
{
9
10
    protected $collection = [];
11
12
    protected $mappingClasses = [];
13
14
    protected $propNameMap = [];
15
16
    /**
17
     * Add item
18
     */
19
    public function add($header)
20
    {
21
        if (is_array($header)) {
22
            $this->collection[] = new Header($header);
23
        } elseif (is_object($header) && $header instanceof Header) {
24
            $this->collection[] = $header;
25
        }
26
27
        return $this;
28
    }
29
30
    /**
31
     * Get items
32
     */
33
    public function getAll()
34
    {
35
        return $this->collection;
36
    }
37
}
38

src/Yandex/Metrica/Management/Models/Accounts.php 1 location

@@ 7-41 (lines=35) @@
4
5
use Yandex\Common\ObjectModel;
6
7
class Accounts extends ObjectModel
8
{
9
10
    protected $collection = [];
11
12
    protected $mappingClasses = [];
13
14
    protected $propNameMap = [];
15
16
    /**
17
     * Add item
18
     * @param Account $account
19
     *
20
     * @return $this
21
     */
22
    public function add($account)
23
    {
24
        if (is_array($account)) {
25
            $this->collection[] = new Account($account);
26
        } elseif (is_object($account) && $account instanceof Account) {
27
            $this->collection[] = $account;
28
        }
29
30
        return $this;
31
    }
32
33
    /**
34
     * Get items
35
     * @return Account[]
36
     */
37
    public function getAll()
38
    {
39
        return $this->collection;
40
    }
41
}
42

src/Yandex/Metrica/Management/Models/Conditions.php 1 location

@@ 7-37 (lines=31) @@
4
5
use Yandex\Common\ObjectModel;
6
7
class Conditions extends ObjectModel
8
{
9
10
    protected $collection = [];
11
12
    protected $mappingClasses = [];
13
14
    protected $propNameMap = [];
15
16
    /**
17
     * Add item
18
     */
19
    public function add($condition)
20
    {
21
        if (is_array($condition)) {
22
            $this->collection[] = new Condition($condition);
23
        } elseif (is_object($condition) && $condition instanceof Condition) {
24
            $this->collection[] = $condition;
25
        }
26
27
        return $this;
28
    }
29
30
    /**
31
     * Get items
32
     */
33
    public function getAll()
34
    {
35
        return $this->collection;
36
    }
37
}
38

src/Yandex/Metrica/Management/Models/Counters.php 1 location

@@ 7-37 (lines=31) @@
4
5
use Yandex\Common\ObjectModel;
6
7
class Counters extends ObjectModel
8
{
9
10
    protected $collection = [];
11
12
    protected $mappingClasses = [];
13
14
    protected $propNameMap = [];
15
16
    /**
17
     * Add item
18
     */
19
    public function add($counterItem)
20
    {
21
        if (is_array($counterItem)) {
22
            $this->collection[] = new CounterItem($counterItem);
23
        } elseif (is_object($counterItem) && $counterItem instanceof CounterItem) {
24
            $this->collection[] = $counterItem;
25
        }
26
27
        return $this;
28
    }
29
30
    /**
31
     * Get items
32
     */
33
    public function getAll()
34
    {
35
        return $this->collection;
36
    }
37
}
38

src/Yandex/Metrica/Management/Models/Delegates.php 1 location

@@ 7-39 (lines=33) @@
4
5
use Yandex\Common\ObjectModel;
6
7
class Delegates extends ObjectModel
8
{
9
10
    protected $collection = [];
11
12
    protected $mappingClasses = [];
13
14
    protected $propNameMap = [];
15
16
    /**
17
     * @param Delegate|array $delegate
18
     *
19
     * @return $this
20
     */
21
    public function add($delegate)
22
    {
23
        if (is_array($delegate)) {
24
            $this->collection[] = new Delegate($delegate);
25
        } elseif (is_object($delegate) && $delegate instanceof Delegate) {
26
            $this->collection[] = $delegate;
27
        }
28
29
        return $this;
30
    }
31
32
    /**
33
     * @return Delegate[]
34
     */
35
    public function getAll()
36
    {
37
        return $this->collection;
38
    }
39
}
40

src/Yandex/Metrica/Management/Models/Filters.php 1 location

@@ 7-39 (lines=33) @@
4
5
use Yandex\Common\ObjectModel;
6
7
class Filters extends ObjectModel
8
{
9
10
    protected $collection = [];
11
12
    protected $mappingClasses = [];
13
14
    protected $propNameMap = [];
15
16
    /**
17
     * @param Filter|array $filter
18
     *
19
     * @return $this
20
     */
21
    public function add($filter)
22
    {
23
        if (is_array($filter)) {
24
            $this->collection[] = new Filter($filter);
25
        } elseif (is_object($filter) && $filter instanceof Filter) {
26
            $this->collection[] = $filter;
27
        }
28
29
        return $this;
30
    }
31
32
    /**
33
     * @return Filter[]
34
     */
35
    public function getAll()
36
    {
37
        return $this->collection;
38
    }
39
}
40

src/Yandex/Metrica/Management/Models/Goals.php 1 location

@@ 7-39 (lines=33) @@
4
5
use Yandex\Common\ObjectModel;
6
7
class Goals extends ObjectModel
8
{
9
10
    protected $collection = [];
11
12
    protected $mappingClasses = [];
13
14
    protected $propNameMap = [];
15
16
    /**
17
     * @param Goal|array $goal
18
     *
19
     * @return $this
20
     */
21
    public function add($goal)
22
    {
23
        if (is_array($goal)) {
24
            $this->collection[] = new Goal($goal);
25
        } elseif (is_object($goal) && $goal instanceof Goal) {
26
            $this->collection[] = $goal;
27
        }
28
29
        return $this;
30
    }
31
32
    /**
33
     * @return Goal[]
34
     */
35
    public function getAll()
36
    {
37
        return $this->collection;
38
    }
39
}
40

src/Yandex/Metrica/Management/Models/Grants.php 1 location

@@ 7-39 (lines=33) @@
4
5
use Yandex\Common\ObjectModel;
6
7
class Grants extends ObjectModel
8
{
9
10
    protected $collection = [];
11
12
    protected $mappingClasses = [];
13
14
    protected $propNameMap = [];
15
16
    /**
17
     * @param array|Grant $grant
18
     *
19
     * @return $this
20
     */
21
    public function add($grant)
22
    {
23
        if (is_array($grant)) {
24
            $this->collection[] = new Grant($grant);
25
        } elseif (is_object($grant) && $grant instanceof Grant) {
26
            $this->collection[] = $grant;
27
        }
28
29
        return $this;
30
    }
31
32
    /**
33
     * @return Grant[]
34
     */
35
    public function getAll()
36
    {
37
        return $this->collection;
38
    }
39
}
40

src/Yandex/Metrica/Management/Models/Operations.php 1 location

@@ 7-39 (lines=33) @@
4
5
use Yandex\Common\ObjectModel;
6
7
class Operations extends ObjectModel
8
{
9
10
    protected $collection = [];
11
12
    protected $mappingClasses = [];
13
14
    protected $propNameMap = [];
15
16
    /**
17
     * @param array|Operation $operation
18
     *
19
     * @return $this
20
     */
21
    public function add($operation)
22
    {
23
        if (is_array($operation)) {
24
            $this->collection[] = new Operation($operation);
25
        } elseif (is_object($operation) && $operation instanceof Operation) {
26
            $this->collection[] = $operation;
27
        }
28
29
        return $this;
30
    }
31
32
    /**
33
     * @return Operation[]
34
     */
35
    public function getAll()
36
    {
37
        return $this->collection;
38
    }
39
}
40

src/Yandex/Metrica/Stat/Models/ComparisonData.php 1 location

@@ 7-38 (lines=32) @@
4
5
use Yandex\Common\ObjectModel;
6
7
class ComparisonData extends ObjectModel
8
{
9
10
    protected $collection = [];
11
12
    protected $mappingClasses = [];
13
14
    protected $propNameMap = [];
15
16
    /**
17
     * Add item
18
     */
19
    public function add($comparisonItems)
20
    {
21
        if (is_array($comparisonItems)) {
22
            $this->collection[] = new ComparisonItems($comparisonItems);
23
        } elseif (is_object($comparisonItems) && $comparisonItems instanceof ComparisonItems) {
24
            $this->collection[] = $comparisonItems;
25
        }
26
27
        return $this;
28
    }
29
30
    /**
31
     * Get items
32
     * @return ComparisonItems[]
33
     */
34
    public function getAll()
35
    {
36
        return $this->collection;
37
    }
38
}
39

src/Yandex/Metrica/Stat/Models/Data.php 1 location

@@ 7-37 (lines=31) @@
4
5
use Yandex\Common\ObjectModel;
6
7
class Data extends ObjectModel
8
{
9
10
    protected $collection = [];
11
12
    protected $mappingClasses = [];
13
14
    protected $propNameMap = [];
15
16
    /**
17
     * Add item
18
     */
19
    public function add($items)
20
    {
21
        if (is_array($items)) {
22
            $this->collection[] = new Items($items);
23
        } elseif (is_object($items) && $items instanceof Items) {
24
            $this->collection[] = $items;
25
        }
26
27
        return $this;
28
    }
29
30
    /**
31
     * Get items
32
     */
33
    public function getAll()
34
    {
35
        return $this->collection;
36
    }
37
}
38

src/Yandex/Metrica/Stat/Models/Dimensions.php 1 location

@@ 7-38 (lines=32) @@
4
5
use Yandex\Common\ObjectModel;
6
7
class Dimensions extends ObjectModel
8
{
9
10
    protected $collection = [];
11
12
    protected $mappingClasses = [];
13
14
    protected $propNameMap = [];
15
16
    /**
17
     * Add item
18
     */
19
    public function add($dimension)
20
    {
21
        if (is_array($dimension)) {
22
            $this->collection[] = new Dimension($dimension);
23
        } elseif (is_object($dimension) && $dimension instanceof Dimension) {
24
            $this->collection[] = $dimension;
25
        }
26
27
        return $this;
28
    }
29
30
    /**
31
     * Get items
32
     * @return Dimension[]
33
     */
34
    public function getAll()
35
    {
36
        return $this->collection;
37
    }
38
}
39

src/Yandex/Metrica/Stat/Models/DrillDownComparisonData.php 1 location

@@ 7-39 (lines=33) @@
4
5
use Yandex\Common\ObjectModel;
6
7
class DrillDownComparisonData extends ObjectModel
8
{
9
10
    protected $collection = [];
11
12
    protected $mappingClasses = [];
13
14
    protected $propNameMap = [];
15
16
    /**
17
     * Add item
18
     */
19
    public function add($drillDownComparisonItems)
20
    {
21
        if (is_array($drillDownComparisonItems)) {
22
            $this->collection[] = new DrillDownComparisonItems($drillDownComparisonItems);
23
        } elseif (is_object($drillDownComparisonItems)
24
            && $drillDownComparisonItems instanceof DrillDownComparisonItems
25
        ) {
26
            $this->collection[] = $drillDownComparisonItems;
27
        }
28
29
        return $this;
30
    }
31
32
    /**
33
     * Get items
34
     */
35
    public function getAll()
36
    {
37
        return $this->collection;
38
    }
39
}
40

src/Yandex/Metrica/Stat/Models/DrillDownData.php 1 location

@@ 7-37 (lines=31) @@
4
5
use Yandex\Common\ObjectModel;
6
7
class DrillDownData extends ObjectModel
8
{
9
10
    protected $collection = [];
11
12
    protected $mappingClasses = [];
13
14
    protected $propNameMap = [];
15
16
    /**
17
     * Add item
18
     */
19
    public function add($drillDownItems)
20
    {
21
        if (is_array($drillDownItems)) {
22
            $this->collection[] = new DrillDownItems($drillDownItems);
23
        } elseif (is_object($drillDownItems) && $drillDownItems instanceof DrillDownItems) {
24
            $this->collection[] = $drillDownItems;
25
        }
26
27
        return $this;
28
    }
29
30
    /**
31
     * Get items
32
     */
33
    public function getAll()
34
    {
35
        return $this->collection;
36
    }
37
}
38