Skip to main content
summaryrefslogtreecommitdiffstats
blob: c0ba0396ec15824b44d065079334f2ac4ce6afb5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
##included template. Generates the @OneToMany methods.
##Assumes that the context has a "role" object representing the generated AssociationRole
##
	public $role.referencedTable.className $customizer.propertyAdd($role.propertyName)($role.referencedTable.className $customizer.convertToSingularisedString($role.propertyName)) {
		$customizer.propertyGetter($role.propertyName)().add($customizer.convertToSingularisedString($role.propertyName));
		$customizer.convertToSingularisedString($role.propertyName).$customizer.propertySetter($role.oppositeRole.propertyName)(this);

		return $customizer.convertToSingularisedString($role.propertyName);
	}

	public $role.referencedTable.className $customizer.propertyRemove($role.propertyName)($role.referencedTable.className $customizer.convertToSingularisedString($role.propertyName)) {
		$customizer.propertyGetter($role.propertyName)().remove($customizer.convertToSingularisedString($role.propertyName));
		$customizer.convertToSingularisedString($role.propertyName).$customizer.propertySetter($role.oppositeRole.propertyName)(null);

		return $customizer.convertToSingularisedString($role.propertyName);
	}

Back to the top