@@ -47,6 +47,9 @@ discard block |
||
| 47 | 47 | return $this->serializer->serialize($this->V3Edmx, "xml"); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | + /** |
|
| 51 | + * @param string $name |
|
| 52 | + */ |
|
| 50 | 53 | public function addEntityType($name, $accessType = "Public", $summary = null, $longDescription = null) |
| 51 | 54 | { |
| 52 | 55 | $this->startEdmxTransaction(); |
@@ -124,6 +127,11 @@ discard block |
||
| 124 | 127 | $this->oldEdmx = null; |
| 125 | 128 | } |
| 126 | 129 | |
| 130 | + /** |
|
| 131 | + * @param string $name |
|
| 132 | + * @param string $type |
|
| 133 | + * @param string $storeGeneratedPattern |
|
| 134 | + */ |
|
| 127 | 135 | public function addPropertyToEntityType( |
| 128 | 136 | $entityType, |
| 129 | 137 | $name, |
@@ -164,6 +172,11 @@ discard block |
||
| 164 | 172 | return $NewProperty; |
| 165 | 173 | } |
| 166 | 174 | |
| 175 | + /** |
|
| 176 | + * @param string $principalMultiplicity |
|
| 177 | + * @param string $principalProperty |
|
| 178 | + * @param string $dependentMultiplicity |
|
| 179 | + */ |
|
| 167 | 180 | public function addNavigationPropertyToEntityType( |
| 168 | 181 | TEntityTypeType $principalType, |
| 169 | 182 | $principalMultiplicity, |
@@ -331,6 +344,10 @@ discard block |
||
| 331 | 344 | return $association; |
| 332 | 345 | } |
| 333 | 346 | |
| 347 | + /** |
|
| 348 | + * @param string $principalEntitySetName |
|
| 349 | + * @param string $dependentEntitySetName |
|
| 350 | + */ |
|
| 334 | 351 | protected function createAssocationSetForAssocation( |
| 335 | 352 | TAssociationType $association, |
| 336 | 353 | $principalEntitySetName, |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | if (!$this->V3Edmx->isOK($msg)) { |
| 31 | 31 | throw new \Exception($msg); |
| 32 | 32 | } |
| 33 | - $ymlDir = __DIR__ . DIRECTORY_SEPARATOR . "MetadataV3" . DIRECTORY_SEPARATOR . "JMSmetadata"; |
|
| 33 | + $ymlDir = __DIR__.DIRECTORY_SEPARATOR."MetadataV3".DIRECTORY_SEPARATOR."JMSmetadata"; |
|
| 34 | 34 | $this->serializer = |
| 35 | 35 | SerializerBuilder::create() |
| 36 | 36 | ->addMetadataDir($ymlDir) |
@@ -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); |
@@ -106,11 +106,11 @@ discard block |
||
| 106 | 106 | $last_letter = strtolower($singular[strlen($singular) - 1]); |
| 107 | 107 | switch ($last_letter) { |
| 108 | 108 | case 'y': |
| 109 | - return substr($singular, 0, -1) . 'ies'; |
|
| 109 | + return substr($singular, 0, -1).'ies'; |
|
| 110 | 110 | case 's': |
| 111 | - return $singular . 'es'; |
|
| 111 | + return $singular.'es'; |
|
| 112 | 112 | default: |
| 113 | - return $singular . 's'; |
|
| 113 | + return $singular.'s'; |
|
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | |
@@ -185,20 +185,20 @@ discard block |
||
| 185 | 185 | $this->startEdmxTransaction(); |
| 186 | 186 | $principalEntitySetName = $this->pluralize(2, $principalType->getName()); |
| 187 | 187 | $dependentEntitySetName = $this->pluralize(2, $dependentType->getName()); |
| 188 | - $relationName = $principalType->getName() . "_" . $principalProperty . "_" . $dependentType->getName() . "_" . $dependentProperty; |
|
| 188 | + $relationName = $principalType->getName()."_".$principalProperty."_".$dependentType->getName()."_".$dependentProperty; |
|
| 189 | 189 | $relationName = trim($relationName, "_"); |
| 190 | 190 | |
| 191 | 191 | $namespace = $this->V3Edmx->getDataServices()[0]->getNamespace(); |
| 192 | 192 | if (0 == strlen(trim($namespace))) { |
| 193 | 193 | $relationFQName = $relationName; |
| 194 | 194 | } else { |
| 195 | - $relationFQName = $namespace . "." . $relationName; |
|
| 195 | + $relationFQName = $namespace.".".$relationName; |
|
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | $principalNavigationProperty = new TNavigationPropertyType(); |
| 199 | 199 | $principalNavigationProperty->setName($principalProperty); |
| 200 | - $principalNavigationProperty->setToRole($dependentEntitySetName . "_" . $dependentProperty); |
|
| 201 | - $principalNavigationProperty->setFromRole($principalEntitySetName . "_" . $principalProperty); |
|
| 200 | + $principalNavigationProperty->setToRole($dependentEntitySetName."_".$dependentProperty); |
|
| 201 | + $principalNavigationProperty->setFromRole($principalEntitySetName."_".$principalProperty); |
|
| 202 | 202 | $principalNavigationProperty->setRelationship($relationFQName); |
| 203 | 203 | $principalNavigationProperty->setGetterAccess($principalGetterAccess); |
| 204 | 204 | $principalNavigationProperty->setSetterAccess($principalSetterAccess); |
@@ -214,8 +214,8 @@ discard block |
||
| 214 | 214 | if (!empty($dependentProperty)) { |
| 215 | 215 | $dependentNavigationProperty = new TNavigationPropertyType(); |
| 216 | 216 | $dependentNavigationProperty->setName($dependentProperty); |
| 217 | - $dependentNavigationProperty->setToRole($principalEntitySetName . "_" . $principalProperty); |
|
| 218 | - $dependentNavigationProperty->setFromRole($dependentEntitySetName . "_" . $dependentProperty); |
|
| 217 | + $dependentNavigationProperty->setToRole($principalEntitySetName."_".$principalProperty); |
|
| 218 | + $dependentNavigationProperty->setFromRole($dependentEntitySetName."_".$dependentProperty); |
|
| 219 | 219 | $dependentNavigationProperty->setRelationship($relationFQName); |
| 220 | 220 | $dependentNavigationProperty->setGetterAccess($dependentGetterAccess); |
| 221 | 221 | $dependentNavigationProperty->setSetterAccess($dependentSetterAccess); |
@@ -281,8 +281,8 @@ discard block |
||
| 281 | 281 | $principalTypeFQName = $principalType->getName(); |
| 282 | 282 | $dependentTypeFQName = $dependentType->getName(); |
| 283 | 283 | } else { |
| 284 | - $principalTypeFQName = $namespace . "." . $principalType->getName(); |
|
| 285 | - $dependentTypeFQName = $namespace . "." . $dependentType->getName(); |
|
| 284 | + $principalTypeFQName = $namespace.".".$principalType->getName(); |
|
| 285 | + $dependentTypeFQName = $namespace.".".$dependentType->getName(); |
|
| 286 | 286 | } |
| 287 | 287 | $association = new TAssociationType(); |
| 288 | 288 | $relationship = $principalNavigationProperty->getRelationship(); |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | if (0 == strlen(trim($namespace))) { |
| 344 | 344 | $associationSetName = $association->getName(); |
| 345 | 345 | } else { |
| 346 | - $associationSetName = $namespace . "." . $association->getName(); |
|
| 346 | + $associationSetName = $namespace.".".$association->getName(); |
|
| 347 | 347 | } |
| 348 | 348 | $as->setAssociation($associationSetName); |
| 349 | 349 | $end1 = new EndAnonymousType(); |