EcProfileSerializer::id()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 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