Completed
Push — master ( 22ee83...d51193 )
by
unknown
03:10
created

AdStudyObjective   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 6

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 6
dl 0
loc 43
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getFieldsEnum() 0 3 1
A getReferencedEnums() 0 6 1
B getSelf() 0 24 2
1
<?php
2
/**
3
 * Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
4
 *
5
 * You are hereby granted a non-exclusive, worldwide, royalty-free license to
6
 * use, copy, modify, and distribute this software in source code or binary
7
 * form for use in connection with the web services and APIs provided by
8
 * Facebook.
9
 *
10
 * As with any software that integrates with the Facebook platform, your use
11
 * of this software is subject to the Facebook Developer Principles and
12
 * Policies [http://developers.facebook.com/policy/]. This copyright notice
13
 * shall be included in all copies or substantial portions of the software.
14
 *
15
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21
 * DEALINGS IN THE SOFTWARE.
22
 *
23
 */
24
25
namespace FacebookAds\Object;
26
27
use FacebookAds\ApiRequest;
28
use FacebookAds\Cursor;
29
use FacebookAds\Http\RequestInterface;
30
use FacebookAds\TypeChecker;
31
use FacebookAds\Object\Fields\AdStudyObjectiveFields;
32
use FacebookAds\Object\Values\AdStudyObjectiveBreakdownsValues;
33
use FacebookAds\Object\Values\AdStudyObjectiveTypeValues;
34
35
/**
36
 * This class is auto-genereated.
37
 *
38
 * For any issues or feature requests related to this class, please let us know
39
 * on github and we'll fix in our codegen framework. We'll not be able to accept
40
 * pull request for this class.
41
 *
42
 */
43
44
class AdStudyObjective extends AbstractCrudObject {
45
46
  /**
47
   * @return AdStudyObjectiveFields
48
   */
49
  public static function getFieldsEnum() {
50
    return AdStudyObjectiveFields::getInstance();
51
  }
52
53
  protected static function getReferencedEnums() {
54
    $ref_enums = array();
55
    $ref_enums['Breakdowns'] = AdStudyObjectiveBreakdownsValues::getInstance()->getValues();
56
    $ref_enums['Type'] = AdStudyObjectiveTypeValues::getInstance()->getValues();
57
    return $ref_enums;
58
  }
59
60
61
  public function getSelf(array $fields = array(), array $params = array(), $pending = false) {
62
    $this->assureId();
63
64
    $param_types = array(
65
      'breakdowns' => 'list<breakdowns_enum>',
66
    );
67
    $enums = array(
68
      'breakdowns_enum' => AdStudyObjectiveBreakdownsValues::getInstance()->getValues(),
69
    );
70
71
    $request = new ApiRequest(
72
      $this->api,
73
      $this->data['id'],
74
      RequestInterface::METHOD_GET,
75
      '/',
76
      new AdStudyObjective(),
77
      'NODE',
78
      AdStudyObjective::getFieldsEnum()->getValues(),
79
      new TypeChecker($param_types, $enums)
80
    );
81
    $request->addParams($params);
82
    $request->addFields($fields);
83
    return $pending ? $request : $request->execute();
84
  }
85
86
}
87