EcProfileSerializer   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 3
c 3
b 0
f 0
lcom 0
cbo 1
dl 0
loc 24
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A attributes() 0 3 1
A id() 0 3 1
A getId() 0 3 1
1
<?php
2
3
/**
4
 * @file
5
 * Contains Drupal\esdportal_api\Serializers\EcProfileSerializer.
6
 */
7
8
namespace Drupal\esdportal_api\Serializers;
9
10
use Tobscure\JsonApi\SerializerAbstract;
11
/**
12
 * Serializes early childhood center profiles.
13
 */
14
class EcProfileSerializer extends SerializerAbstract {
15
  protected $type = 'ec_profiles';
16
17
  /**
18
   * Nothing special here.
19
   */
20
  protected function attributes($ec_profile) {
21
    return $ec_profile;
22
  }
23
24
  /**
25
   * Provides the id.
26
   */
27
  protected function id($ec_profile) {
28
    return $ec_profile->nid;
29
  }
30
  /**
31
   * For backwards compatibility... do the same thing.
32
   */
33
  protected function getId($ec_profile) {
34
    return $ec_profile->nid;
35
  }
36
37
}
38