summaryrefslogtreecommitdiffstats
path: root/includes/mapboxjs.entity.inc
blob: f4f5ec2ad99777ae74e473613e630571ac5ea467 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php

/**
 * Entity class for MapBox.js map presets
 */
class MapboxjsPreset extends Entity {

  public
    $mapboxjs_preset_id,
    $name,
    $label,
    $settings,
    $created,
    $updated;

  public function __construct(array $values = array()) {
    parent::__construct($values, 'mapboxjs_preset');
  }

  public function save() {
    $this->updated = REQUEST_TIME;
    if (isset($this->is_new) && $this->is_new) {
      $this->created = REQUEST_TIME;
    }
    return parent::save();
  }

  protected function defaultUri() {
    return array('path' => 'admin/structure/mapboxjs/presets/manage/' . $this->identifier());
  }

}