@@ -49,6 +49,9 @@ discard block |
||
49 | 49 | return $this->serializer->serialize($this->getEdmx(), "xml"); |
50 | 50 | } |
51 | 51 | |
52 | + /** |
|
53 | + * @param string $name |
|
54 | + */ |
|
52 | 55 | public function addEntityType($name, $accessType = "Public", $summary = null, $longDescription = null) |
53 | 56 | { |
54 | 57 | $NewEntity = new TEntityTypeType(); |
@@ -124,6 +127,11 @@ discard block |
||
124 | 127 | return $NewProperty; |
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, |
@@ -161,6 +169,11 @@ discard block |
||
161 | 169 | return $NewProperty; |
162 | 170 | } |
163 | 171 | |
172 | + /** |
|
173 | + * @param string $principalMultiplicity |
|
174 | + * @param string $principalProperty |
|
175 | + * @param string $dependentMultiplicity |
|
176 | + */ |
|
164 | 177 | public function addNavigationPropertyToEntityType( |
165 | 178 | TEntityTypeType $principalType, |
166 | 179 | $principalMultiplicity, |
@@ -337,6 +350,10 @@ discard block |
||
337 | 350 | return $association; |
338 | 351 | } |
339 | 352 | |
353 | + /** |
|
354 | + * @param string $principalEntitySetName |
|
355 | + * @param string $dependentEntitySetName |
|
356 | + */ |
|
340 | 357 | protected function createAssocationSetForAssocation( |
341 | 358 | TAssociationType $association, |
342 | 359 | $principalEntitySetName, |
@@ -15,8 +15,6 @@ |
||
15 | 15 | use AlgoWeb\ODataMetadata\MetadataV3\edm\TEntityPropertyType; |
16 | 16 | use AlgoWeb\ODataMetadata\MetadataV3\edm\TEntityTypeType; |
17 | 17 | use AlgoWeb\ODataMetadata\MetadataV3\edm\TFunctionImportReturnTypeType; |
18 | -use AlgoWeb\ODataMetadata\MetadataV3\edm\TFunctionReturnTypeType; |
|
19 | -use AlgoWeb\ODataMetadata\MetadataV3\edm\TFunctionType; |
|
20 | 18 | use AlgoWeb\ODataMetadata\MetadataV3\edm\TNavigationPropertyType; |
21 | 19 | use AlgoWeb\ODataMetadata\MetadataV3\edm\TPropertyRefType; |
22 | 20 | use AlgoWeb\ODataMetadata\MetadataV3\edm\TReferentialConstraintRoleElementType; |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | if (0 == strlen(trim($namespace))) { |
70 | 70 | $entityTypeName = $NewEntity->getName(); |
71 | 71 | } else { |
72 | - $entityTypeName = $namespace . "." . $NewEntity->getName(); |
|
72 | + $entityTypeName = $namespace.".".$NewEntity->getName(); |
|
73 | 73 | } |
74 | 74 | $entitySet->setEntityType($entityTypeName); |
75 | 75 | $entitySet->setGetterAccess($accessType); |
@@ -190,21 +190,21 @@ discard block |
||
190 | 190 | ) { |
191 | 191 | $principalEntitySetName = Str::plural($principalType->getName(), 2); |
192 | 192 | $dependentEntitySetName = Str::plural($dependentType->getName(), 2); |
193 | - $relationName = $principalType->getName() . "_" . $principalProperty . "_" |
|
194 | - . $dependentType->getName() . "_" . $dependentProperty; |
|
193 | + $relationName = $principalType->getName()."_".$principalProperty."_" |
|
194 | + . $dependentType->getName()."_".$dependentProperty; |
|
195 | 195 | $relationName = trim($relationName, "_"); |
196 | 196 | |
197 | 197 | $namespace = $this->V3Edmx->getDataServiceType()->getSchema()[0]->getNamespace(); |
198 | 198 | if (0 == strlen(trim($namespace))) { |
199 | 199 | $relationFQName = $relationName; |
200 | 200 | } else { |
201 | - $relationFQName = $namespace . "." . $relationName; |
|
201 | + $relationFQName = $namespace.".".$relationName; |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | $principalNavigationProperty = new TNavigationPropertyType(); |
205 | 205 | $principalNavigationProperty->setName($principalProperty); |
206 | - $principalNavigationProperty->setToRole(trim($dependentEntitySetName . "_" . $dependentProperty, "_")); |
|
207 | - $principalNavigationProperty->setFromRole($principalEntitySetName . "_" . $principalProperty); |
|
206 | + $principalNavigationProperty->setToRole(trim($dependentEntitySetName."_".$dependentProperty, "_")); |
|
207 | + $principalNavigationProperty->setFromRole($principalEntitySetName."_".$principalProperty); |
|
208 | 208 | $principalNavigationProperty->setRelationship($relationFQName); |
209 | 209 | $principalNavigationProperty->setGetterAccess($principalGetterAccess); |
210 | 210 | $principalNavigationProperty->setSetterAccess($principalSetterAccess); |
@@ -219,8 +219,8 @@ discard block |
||
219 | 219 | if (!empty($dependentProperty)) { |
220 | 220 | $dependentNavigationProperty = new TNavigationPropertyType(); |
221 | 221 | $dependentNavigationProperty->setName($dependentProperty); |
222 | - $dependentNavigationProperty->setToRole($principalEntitySetName . "_" . $principalProperty); |
|
223 | - $dependentNavigationProperty->setFromRole($dependentEntitySetName . "_" . $dependentProperty); |
|
222 | + $dependentNavigationProperty->setToRole($principalEntitySetName."_".$principalProperty); |
|
223 | + $dependentNavigationProperty->setFromRole($dependentEntitySetName."_".$dependentProperty); |
|
224 | 224 | $dependentNavigationProperty->setRelationship($relationFQName); |
225 | 225 | $dependentNavigationProperty->setGetterAccess($dependentGetterAccess); |
226 | 226 | $dependentNavigationProperty->setSetterAccess($dependentSetterAccess); |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | array $principalConstraintProperty = null, |
272 | 272 | array $dependentConstraintProperty = null |
273 | 273 | ) { |
274 | - $multCombo = [ '*' => ['*', '1'], '0..1' => ['1'], '1' => ['*', '0..1']]; |
|
274 | + $multCombo = ['*' => ['*', '1'], '0..1' => ['1'], '1' => ['*', '0..1']]; |
|
275 | 275 | $multKeys = array_keys($multCombo); |
276 | 276 | if (null != $dependentNavigationProperty) { |
277 | 277 | if ($dependentNavigationProperty->getRelationship() != $principalNavigationProperty->getRelationship()) { |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | } |
291 | 291 | if (!in_array($dependentMultiplicity, $multCombo[$principalMultiplicity])) { |
292 | 292 | throw new \InvalidArgumentException( |
293 | - "Invalid multiplicity combination - ". $principalMultiplicity . ' ' . $dependentMultiplicity |
|
293 | + "Invalid multiplicity combination - ".$principalMultiplicity.' '.$dependentMultiplicity |
|
294 | 294 | ); |
295 | 295 | } |
296 | 296 | |
@@ -300,8 +300,8 @@ discard block |
||
300 | 300 | $principalTypeFQName = $principalType->getName(); |
301 | 301 | $dependentTypeFQName = $dependentType->getName(); |
302 | 302 | } else { |
303 | - $principalTypeFQName = $namespace . "." . $principalType->getName(); |
|
304 | - $dependentTypeFQName = $namespace . "." . $dependentType->getName(); |
|
303 | + $principalTypeFQName = $namespace.".".$principalType->getName(); |
|
304 | + $dependentTypeFQName = $namespace.".".$dependentType->getName(); |
|
305 | 305 | } |
306 | 306 | $association = new TAssociationType(); |
307 | 307 | $relationship = $principalNavigationProperty->getRelationship(); |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | if (0 == strlen(trim($namespace))) { |
370 | 370 | $associationSetName = $association->getName(); |
371 | 371 | } else { |
372 | - $associationSetName = $namespace . "." . $association->getName(); |
|
372 | + $associationSetName = $namespace.".".$association->getName(); |
|
373 | 373 | } |
374 | 374 | $as->setAssociation($associationSetName); |
375 | 375 | $end1 = new EndAnonymousType(); |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | |
436 | 436 | private function initSerialiser() |
437 | 437 | { |
438 | - $ymlDir = __DIR__ . DIRECTORY_SEPARATOR . "MetadataV3" . DIRECTORY_SEPARATOR . "JMSmetadata"; |
|
438 | + $ymlDir = __DIR__.DIRECTORY_SEPARATOR."MetadataV3".DIRECTORY_SEPARATOR."JMSmetadata"; |
|
439 | 439 | $this->serializer = |
440 | 440 | SerializerBuilder::create() |
441 | 441 | ->addMetadataDir($ymlDir) |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | public function isTFunctionImportAttributesValid(&$msg) |
266 | 266 | { |
267 | 267 | if (!$this->isTSimpleIdentifierValid($this->name)) { |
268 | - $msg = "Name must be a valid TSimpleIdentifier: " . get_class($this); |
|
268 | + $msg = "Name must be a valid TSimpleIdentifier: ".get_class($this); |
|
269 | 269 | return false; |
270 | 270 | } |
271 | 271 | if ($this->isComposable && $this->isSideEffecting) { |
@@ -278,11 +278,11 @@ discard block |
||
278 | 278 | return false; |
279 | 279 | }*/ |
280 | 280 | if (!$this->isObjectNullOrType('\AlgoWeb\ODataMetadata\MetadataV3\edm\TOperandType', $this->entitySet)) { |
281 | - $msg = "Entity set must be either null or an instance of TOperandType: " . get_class($this); |
|
281 | + $msg = "Entity set must be either null or an instance of TOperandType: ".get_class($this); |
|
282 | 282 | return false; |
283 | 283 | } |
284 | 284 | if (null != $this->methodAccess && $this->isTAccessOk($this->methodAccess)) { |
285 | - $msg = "Method access must be a valid TAccess: " . get_class($this); |
|
285 | + $msg = "Method access must be a valid TAccess: ".get_class($this); |
|
286 | 286 | return false; |
287 | 287 | } |
288 | 288 | if (!$this->isValidArrayOK( |
@@ -138,7 +138,7 @@ |
||
138 | 138 | } |
139 | 139 | |
140 | 140 | $numParms = count($this->parameter); |
141 | - for ($i = 0; $i < $numParms -2; $i++) { |
|
141 | + for ($i = 0; $i < $numParms - 2; $i++) { |
|
142 | 142 | $outName = $this->parameter[$i]->getName(); |
143 | 143 | for ($j = $i + 1; $j < $numParms - 1; $j++) { |
144 | 144 | $inName = $this->parameter[$j]->getName(); |
@@ -308,7 +308,7 @@ |
||
308 | 308 | } |
309 | 309 | foreach ($this->returnType as $type) { |
310 | 310 | if (!is_string($type) || !$this->isTCommandTextValid($type)) { |
311 | - $msg = implode($type) . " must be a valid TCommandText"; |
|
311 | + $msg = implode($type)." must be a valid TCommandText"; |
|
312 | 312 | return false; |
313 | 313 | } |
314 | 314 | } |
@@ -8,8 +8,6 @@ |
||
8 | 8 | use AlgoWeb\ODataMetadata\MetadataV3\edm\Schema; |
9 | 9 | use AlgoWeb\ODataMetadata\MetadataV3\edm\TAssociationType; |
10 | 10 | use AlgoWeb\ODataMetadata\MetadataV3\edm\TEntityTypeType; |
11 | -use AlgoWeb\ODataMetadata\MetadataV3\edm\TFunctionReturnTypeType; |
|
12 | -use AlgoWeb\ODataMetadata\MetadataV3\edm\TFunctionType; |
|
13 | 11 | use AlgoWeb\ODataMetadata\MetadataV3\edmx\Edmx; |
14 | 12 | use Mockery as m; |
15 | 13 |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | { |
33 | 33 | $ds = DIRECTORY_SEPARATOR; |
34 | 34 | |
35 | - $goodxsd = dirname(__DIR__) . $ds . "xsd" . $ds . "Microsoft.Data.Entity.Design.Edmx_3.Fixed.xsd"; |
|
35 | + $goodxsd = dirname(__DIR__).$ds."xsd".$ds."Microsoft.Data.Entity.Design.Edmx_3.Fixed.xsd"; |
|
36 | 36 | if (!file_exists($goodxsd)) { |
37 | 37 | return true; |
38 | 38 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $result = null; |
48 | 48 | |
49 | 49 | list($eType, $result) = $metadataManager->addEntityType("Category"); |
50 | - $this->assertNotFalse($eType, "Etype is false not type " . $metadataManager->getLastError()); |
|
50 | + $this->assertNotFalse($eType, "Etype is false not type ".$metadataManager->getLastError()); |
|
51 | 51 | $metadataManager->addPropertyToEntityType($eType, "CategoryID", "Int32", null, false, true, "Identity"); |
52 | 52 | $metadataManager->addPropertyToEntityType($eType, "CategoryName", "String"); |
53 | 53 | $metadataManager->addPropertyToEntityType($eType, "Description", "String"); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $result = null; |
75 | 75 | |
76 | 76 | list($CategoryType, $result) = $metadataManager->addEntityType("Category"); |
77 | - $this->assertNotFalse($CategoryType, "Etype is false not type " . $metadataManager->getLastError()); |
|
77 | + $this->assertNotFalse($CategoryType, "Etype is false not type ".$metadataManager->getLastError()); |
|
78 | 78 | $metadataManager->addPropertyToEntityType($CategoryType, "CategoryID", "Int32", null, false, true, "Identity"); |
79 | 79 | $metadataManager->addPropertyToEntityType($CategoryType, "CategoryName", "String"); |
80 | 80 | $metadataManager->addPropertyToEntityType($CategoryType, "Description", "String"); |
@@ -551,7 +551,7 @@ discard block |
||
551 | 551 | $this->assertTrue($CategoryType->isOK($msg), $msg); |
552 | 552 | $this->assertTrue($CustomerType->isOK($msg), $msg); |
553 | 553 | |
554 | - $expected = "Invalid multiplicity combination - 1 1"; |
|
554 | + $expected = "Invalid multiplicity combination - 1 1"; |
|
555 | 555 | $actual = null; |
556 | 556 | |
557 | 557 | try { |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | $this->assertTrue($CategoryType->isOK($msg), $msg); |
581 | 581 | $this->assertTrue($CustomerType->isOK($msg), $msg); |
582 | 582 | |
583 | - $expected = "Invalid multiplicity combination - * 0..1"; |
|
583 | + $expected = "Invalid multiplicity combination - * 0..1"; |
|
584 | 584 | $actual = null; |
585 | 585 | |
586 | 586 | try { |