-
Notifications
You must be signed in to change notification settings - Fork 0
/
customer.inc
46 lines (43 loc) · 1020 Bytes
/
customer.inc
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/**
* @file
* Provides the customer object.
*/
/**
* Customer class.
*/
class Customer extends Entity {
protected function defaultLabel() {
return $this->name;
}
protected function defaultUri() {
return array('path' => 'customer/' . $this->identifier());
}
}
/**
* CustomerController class.
*/
class CustomerController extends EntityAPIController {
public function create(array $values = array()) {
global $user;
if (!isset($values['name'])) {
$values['name'] = '';
}
if (!isset($values['created'])) {
$values['created'] = REQUEST_TIME;
}
if (!isset($values['changed'])) {
$values['changed'] = 0;
}
if (!isset($values['uid_created'])) {
$values['uid_created'] = $user->uid;
}
if (!isset($values['uid_changed'])) {
$values['uid_changed'] = 0;
}
if (!isset($values['uid_owner'])) {
$values['uid_owner'] = 0;
}
return parent::create($values);
}
}