Fiveessentials2015Serializer::getId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
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\Fiveessentials2015Serializer.
6
 *
7
 * Serializes fiveessentials_2015 records.
8
 */
9
10
namespace Drupal\esdportal_api\Serializers;
11
12
use Tobscure\JsonApi\SerializerAbstract;
13
14
/**
15
 * Serializes fiveessentials_2015 data records.
16
 */
17
class Fiveessentials2015Serializer extends SerializerAbstract {
18
  protected $type = 'fiveessentials_2015s';
19
20
  /**
21
   * Nothing special here, yet.
22
   */
23
  protected function attributes($row) {
24
    return $row;
25
  }
26
27
  /**
28
   * Provides primary key as id.
29
   */
30
  protected function id($row) {
31
    return $row->State_Schl_Id;
32
  }
33
34
  /**
35
   * Backwards-compatible with bnchdrff/json-api version.
36
   */
37
  protected function getId($row) {
38
    return $row->State_Schl_Id;
39
  }
40
41
}
42