Skip to content

Commit 169d1a3

Browse files
committed
Add cascade to OneToMany
1 parent 0506294 commit 169d1a3

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/Ubiquity/attributes/items/OneToMany.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,21 @@
99
* Annotation OneToMany.
1010
* usage :
1111
* - #[OneToMany(mappedBy:"memberName",className:"classname")]
12+
* - #[OneToMany(mappedBy:"memberName",className:"classname",cascade:["remove"])]
1213
*
1314
* @author jc
14-
* @version 1.0.0
15+
* @version 1.0.1
1516
*/
1617
#[Attribute(Attribute::TARGET_PROPERTY)]
1718
class OneToMany extends BaseAttribute {
1819
use BaseAnnotationTrait;
19-
20+
2021
public string $mappedBy;
2122
public string $className;
22-
23-
public function __construct(string $mappedBy,string $className){
24-
$this->mappedBy=$mappedBy;
25-
$this->className=$className;
23+
public ?array $cascade;
24+
25+
public function __construct(string $mappedBy, string $className) {
26+
$this->mappedBy = $mappedBy;
27+
$this->className = $className;
2628
}
2729
}

0 commit comments

Comments
 (0)