@@ -48,6 +48,9 @@ discard block |
||
48 | 48 | return $this->serializer->serialize($this->getEdmx(), "xml"); |
49 | 49 | } |
50 | 50 | |
51 | + /** |
|
52 | + * @param string $name |
|
53 | + */ |
|
51 | 54 | public function addEntityType($name, $accessType = "Public", $summary = null, $longDescription = null) |
52 | 55 | { |
53 | 56 | $NewEntity = new TEntityTypeType(); |
@@ -112,6 +115,11 @@ discard block |
||
112 | 115 | } |
113 | 116 | } |
114 | 117 | |
118 | + /** |
|
119 | + * @param string $name |
|
120 | + * @param string $type |
|
121 | + * @param string $storeGeneratedPattern |
|
122 | + */ |
|
115 | 123 | public function addPropertyToEntityType( |
116 | 124 | $entityType, |
117 | 125 | $name, |
@@ -149,6 +157,11 @@ discard block |
||
149 | 157 | return $NewProperty; |
150 | 158 | } |
151 | 159 | |
160 | + /** |
|
161 | + * @param string $principalMultiplicity |
|
162 | + * @param string $principalProperty |
|
163 | + * @param string $dependentMultiplicity |
|
164 | + */ |
|
152 | 165 | public function addNavigationPropertyToEntityType( |
153 | 166 | TEntityTypeType $principalType, |
154 | 167 | $principalMultiplicity, |
@@ -325,6 +338,10 @@ discard block |
||
325 | 338 | return $association; |
326 | 339 | } |
327 | 340 | |
341 | + /** |
|
342 | + * @param string $principalEntitySetName |
|
343 | + * @param string $dependentEntitySetName |
|
344 | + */ |
|
328 | 345 | protected function createAssocationSetForAssocation( |
329 | 346 | TAssociationType $association, |
330 | 347 | $principalEntitySetName, |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | if (0 == strlen(trim($namespace))) { |
66 | 66 | $entityTypeName = $NewEntity->getName(); |
67 | 67 | } else { |
68 | - $entityTypeName = $namespace . "." . $NewEntity->getName(); |
|
68 | + $entityTypeName = $namespace.".".$NewEntity->getName(); |
|
69 | 69 | } |
70 | 70 | $entitySet->setEntityType($entityTypeName); |
71 | 71 | $entitySet->setGetterAccess($accessType); |
@@ -104,11 +104,11 @@ discard block |
||
104 | 104 | $last_letter = strtolower($singular[strlen($singular) - 1]); |
105 | 105 | switch ($last_letter) { |
106 | 106 | case 'y': |
107 | - return substr($singular, 0, -1) . 'ies'; |
|
107 | + return substr($singular, 0, -1).'ies'; |
|
108 | 108 | case 's': |
109 | - return $singular . 'es'; |
|
109 | + return $singular.'es'; |
|
110 | 110 | default: |
111 | - return $singular . 's'; |
|
111 | + return $singular.'s'; |
|
112 | 112 | } |
113 | 113 | } |
114 | 114 | |
@@ -169,21 +169,21 @@ discard block |
||
169 | 169 | ) { |
170 | 170 | $principalEntitySetName = Str::plural($principalType->getName(), 2); |
171 | 171 | $dependentEntitySetName = Str::plural($dependentType->getName(), 2); |
172 | - $relationName = $principalType->getName() . "_" . $principalProperty . "_" |
|
173 | - . $dependentType->getName() . "_" . $dependentProperty; |
|
172 | + $relationName = $principalType->getName()."_".$principalProperty."_" |
|
173 | + . $dependentType->getName()."_".$dependentProperty; |
|
174 | 174 | $relationName = trim($relationName, "_"); |
175 | 175 | |
176 | 176 | $namespace = $this->V3Edmx->getDataServiceType()->getSchema()[0]->getNamespace(); |
177 | 177 | if (0 == strlen(trim($namespace))) { |
178 | 178 | $relationFQName = $relationName; |
179 | 179 | } else { |
180 | - $relationFQName = $namespace . "." . $relationName; |
|
180 | + $relationFQName = $namespace.".".$relationName; |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | $principalNavigationProperty = new TNavigationPropertyType(); |
184 | 184 | $principalNavigationProperty->setName($principalProperty); |
185 | - $principalNavigationProperty->setToRole(trim($dependentEntitySetName . "_" . $dependentProperty, "_")); |
|
186 | - $principalNavigationProperty->setFromRole($principalEntitySetName . "_" . $principalProperty); |
|
185 | + $principalNavigationProperty->setToRole(trim($dependentEntitySetName."_".$dependentProperty, "_")); |
|
186 | + $principalNavigationProperty->setFromRole($principalEntitySetName."_".$principalProperty); |
|
187 | 187 | $principalNavigationProperty->setRelationship($relationFQName); |
188 | 188 | $principalNavigationProperty->setGetterAccess($principalGetterAccess); |
189 | 189 | $principalNavigationProperty->setSetterAccess($principalSetterAccess); |
@@ -198,8 +198,8 @@ discard block |
||
198 | 198 | if (!empty($dependentProperty)) { |
199 | 199 | $dependentNavigationProperty = new TNavigationPropertyType(); |
200 | 200 | $dependentNavigationProperty->setName($dependentProperty); |
201 | - $dependentNavigationProperty->setToRole($principalEntitySetName . "_" . $principalProperty); |
|
202 | - $dependentNavigationProperty->setFromRole($dependentEntitySetName . "_" . $dependentProperty); |
|
201 | + $dependentNavigationProperty->setToRole($principalEntitySetName."_".$principalProperty); |
|
202 | + $dependentNavigationProperty->setFromRole($dependentEntitySetName."_".$dependentProperty); |
|
203 | 203 | $dependentNavigationProperty->setRelationship($relationFQName); |
204 | 204 | $dependentNavigationProperty->setGetterAccess($dependentGetterAccess); |
205 | 205 | $dependentNavigationProperty->setSetterAccess($dependentSetterAccess); |
@@ -268,8 +268,8 @@ discard block |
||
268 | 268 | $principalTypeFQName = $principalType->getName(); |
269 | 269 | $dependentTypeFQName = $dependentType->getName(); |
270 | 270 | } else { |
271 | - $principalTypeFQName = $namespace . "." . $principalType->getName(); |
|
272 | - $dependentTypeFQName = $namespace . "." . $dependentType->getName(); |
|
271 | + $principalTypeFQName = $namespace.".".$principalType->getName(); |
|
272 | + $dependentTypeFQName = $namespace.".".$dependentType->getName(); |
|
273 | 273 | } |
274 | 274 | $association = new TAssociationType(); |
275 | 275 | $relationship = $principalNavigationProperty->getRelationship(); |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | if (0 == strlen(trim($namespace))) { |
338 | 338 | $associationSetName = $association->getName(); |
339 | 339 | } else { |
340 | - $associationSetName = $namespace . "." . $association->getName(); |
|
340 | + $associationSetName = $namespace.".".$association->getName(); |
|
341 | 341 | } |
342 | 342 | $as->setAssociation($associationSetName); |
343 | 343 | $end1 = new EndAnonymousType(); |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | |
359 | 359 | private function initSerialiser() |
360 | 360 | { |
361 | - $ymlDir = __DIR__ . DIRECTORY_SEPARATOR . "MetadataV3" . DIRECTORY_SEPARATOR . "JMSmetadata"; |
|
361 | + $ymlDir = __DIR__.DIRECTORY_SEPARATOR."MetadataV3".DIRECTORY_SEPARATOR."JMSmetadata"; |
|
362 | 362 | $this->serializer = |
363 | 363 | SerializerBuilder::create() |
364 | 364 | ->addMetadataDir($ymlDir) |