[FEATURE] Introduce AvatarProvider
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Classes / Backend / Avatar / Image.php
1 <?php
2 namespace TYPO3\CMS\Backend\Backend\Avatar;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 /**
18 * Class Image
19 *
20 * Holds url + dimensions of avatar image
21 */
22 class Image {
23
24 /**
25 * Url of avatar image. Needs to be relative to the /typo3/ folder or an absolute URL.
26 *
27 * @var string
28 */
29 protected $url;
30
31 /**
32 * @var int
33 */
34 protected $width;
35
36 /**
37 * @var int
38 */
39 protected $height;
40
41 /**
42 * Constructor
43 *
44 * @param string $url url of image. Needs to be relative to the /typo3/ folder or an absolute URL.
45 * @param int $width width of image
46 * @param int $height height of image
47 */
48 public function __construct($url, $width, $height) {
49 $this->url = $url;
50 $this->width = (int)$width;
51 $this->height = (int)$height;
52 }
53
54 /**
55 * Get url
56 *
57 * @return string
58 */
59 public function getUrl() {
60 return $this->url;
61 }
62
63 /**
64 * Get width
65 *
66 * @return int
67 */
68 public function getWidth() {
69 return $this->width;
70 }
71
72 /**
73 * Get height
74 *
75 * @return int
76 */
77 public function getHeight() {
78 return $this->height;
79 }
80 }