1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* AppserverIo\Psr\EnterpriseBeans\Annotations\PersistenceUnit |
5
|
|
|
* |
6
|
|
|
* NOTICE OF LICENSE |
7
|
|
|
* |
8
|
|
|
* This source file is subject to the Open Software License (OSL 3.0) |
9
|
|
|
* that is available through the world-wide-web at this URL: |
10
|
|
|
* http://opensource.org/licenses/osl-3.0.php |
11
|
|
|
* |
12
|
|
|
* PHP version 5 |
13
|
|
|
* |
14
|
|
|
* @author Tim Wagner <[email protected]> |
15
|
|
|
* @copyright 2015 TechDivision GmbH <[email protected]> |
16
|
|
|
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) |
17
|
|
|
* @link https://github.com/appserver-io-psr/epb |
18
|
|
|
* @link http://www.appserver.io |
19
|
|
|
*/ |
20
|
|
|
|
21
|
|
|
namespace AppserverIo\Psr\EnterpriseBeans\Annotations; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* Annotation implementation representing a @PersistenceUnit annotation on a property. |
25
|
|
|
* |
26
|
|
|
* @author Tim Wagner <[email protected]> |
27
|
|
|
* @copyright 2015 TechDivision GmbH <[email protected]> |
28
|
|
|
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) |
29
|
|
|
* @link https://github.com/appserver-io-psr/epb |
30
|
|
|
* @link http://www.appserver.io |
31
|
|
|
* |
32
|
|
|
* @Annotation |
33
|
|
|
* @Target({"CLASS", "METHOD","PROPERTY"}) |
34
|
|
|
*/ |
35
|
|
|
class PersistenceUnit extends AbstractBeanAnnotation |
36
|
|
|
{ |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* The value of the unitName attribute. |
40
|
|
|
* |
41
|
|
|
* @var string |
42
|
|
|
*/ |
43
|
|
|
protected $unitName; |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* The constructor the initializes the instance with the |
47
|
|
|
* data passed with the token. |
48
|
|
|
* |
49
|
|
|
* @param array $values The annotation values |
50
|
|
|
*/ |
51
|
|
|
public function __construct(array $values = array()) |
52
|
|
|
{ |
53
|
|
|
|
54
|
|
|
// set the unit name attribute, if available |
55
|
|
|
if (isset($values[AnnotationKeys::UNIT_NAME])) { |
56
|
|
|
$this->unitName = $values[AnnotationKeys::UNIT_NAME]; |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
// pass the values through to the parent constructor |
60
|
|
|
parent::__construct($values); |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* Returns the value of the unitName attribute. |
65
|
|
|
* |
66
|
|
|
* @return string|null The annotations unitName attribute |
67
|
|
|
*/ |
68
|
|
|
public function getUnitName() |
69
|
|
|
{ |
70
|
|
|
return $this->unitName; |
71
|
|
|
} |
72
|
|
|
} |
73
|
|
|
|