Meap2012Serializer   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 25
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\Meap2012Serializer.
6
 *
7
 * Serializes meap_2012 records.
8
 */
9
10
namespace Drupal\esdportal_api\Serializers;
11
12
use Tobscure\JsonApi\SerializerAbstract;
13
14
/**
15
 * Serializes meap_2012 data records.
16
 */
17
class Meap2012Serializer extends SerializerAbstract {
18
  protected $type = 'meap_2012s';
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->BuildingCode;
32
  }
33
34
  /**
35
   * Backwards-compatible with bnchdrff/json-api version.
36
   */
37
  protected function getId($row) {
38
    return $row->BuildingCode;
39
  }
40
41
}
42