EcStateRatingSerializer::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\EcStateRatingSerializer.
6
 */
7
8
namespace Drupal\esdportal_api\Serializers;
9
10
use Tobscure\JsonApi\SerializerAbstract;
11
12
/**
13
 * Serializes early childhood state ratings.
14
 */
15
class EcStateRatingSerializer extends SerializerAbstract {
16
  protected $type = 'ec_state_ratings';
17
18
  /**
19
   * Nothing special.
20
   */
21
  protected function attributes($ec_state_rating) {
22
    return $ec_state_rating;
23
  }
24
25
  /**
26
   * Sets the id.
27
   */
28
  protected function id($ec_state_rating) {
29
    return $ec_state_rating->rating_id;
30
  }
31
  /**
32
   * Backwards compatible.
33
   */
34
  protected function getId($ec_state_rating) {
35
    return $ec_state_rating->rating_id;
36
  }
37
38
}
39