1 <?php
2
3 /*
4 * This file is part of the Icybee package.
5 *
6 * (c) Olivier Laviale <olivier.laviale@gmail.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12 namespace Icybee\Modules\Members;
13
14 use ICanBoogie\Operation;
15
16 class Member extends \Icybee\Modules\Users\User
17 {
18 public $salutation_code;
19
20 public $number_work;
21 public $number_home;
22 public $number_fax;
23 public $number_pager;
24 public $number_mobile;
25
26 public $street;
27 public $street_complement;
28 public $city;
29 public $state;
30 public $postalcode;
31 public $country;
32 public $webpage;
33
34 public $birthday;
35
36 public $position;
37 public $service;
38 public $company;
39 public $company_street;
40 public $company_street_complement;
41 public $company_city;
42 public $company_state;
43 public $company_postalcode;
44 public $company_country;
45 public $company_webpage;
46
47 public $misc1;
48 public $misc2;
49 public $misc3;
50 public $misc4;
51 public $notes;
52
53 public $photo;
54
55 /**
56 * Defaults `$model` to "members".
57 *
58 * @param string|\ICanBoogie\ActiveRecord\Model $model
59 */
60 public function __construct($model='members')
61 {
62 parent::__construct($model);
63 }
64
65 // TODO-20110108: thumbnailer should support the 'thumbnail' method for members as well,
66 // or maybe the "images" module should have a special support for users.
67
68 protected function lazy_get_thumbnail()
69 {
70 return $this->thumbnail('primary');
71 }
72
73 public function thumbnail($version) // TODO-20120922: use Thumbnail object
74 {
75 if (!$this->photo)
76 {
77 return;
78 }
79
80 return Operation::encode
81 (
82 'thumbnailer/get', array
83 (
84 'src' => $this->photo,
85 'version' => $version
86 )
87 );
88 }
89 }