4cb0efff57a9683bafc5f0518f4d9408e9599e01
[Packages/TYPO3.CMS.git] / typo3 / sysext / version / Classes / Dependency / ReferenceEntity.php
1 <?php
2 namespace TYPO3\CMS\Version\Dependency;
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 * Object to hold reference information of a database field and one accordant element.
18 */
19 class ReferenceEntity {
20
21 /**
22 * @var \TYPO3\CMS\Version\Dependency\ElementEntity
23 */
24 protected $element;
25
26 /**
27 * @var string
28 */
29 protected $field;
30
31 /**
32 * Creates this object.
33 *
34 * @param \TYPO3\CMS\Version\Dependency\ElementEntity $element
35 * @param string $field
36 */
37 public function __construct(\TYPO3\CMS\Version\Dependency\ElementEntity $element, $field) {
38 $this->element = $element;
39 $this->field = $field;
40 }
41
42 /**
43 * Gets the elements.
44 *
45 * @return \TYPO3\CMS\Version\Dependency\ElementEntity
46 */
47 public function getElement() {
48 return $this->element;
49 }
50
51 /**
52 * Gets the field.
53 *
54 * @return string
55 */
56 public function getField() {
57 return $this->field;
58 }
59
60 /**
61 * Converts this object for string representation.
62 *
63 * @return string
64 */
65 public function __toString() {
66 return $this->element . '.' . $this->field;
67 }
68
69 }