@@ -44,6 +44,9 @@ discard block |
||
44 | 44 | return $this->serializer->serialize($this->V3Edmx, "xml"); |
45 | 45 | } |
46 | 46 | |
47 | + /** |
|
48 | + * @param string $name |
|
49 | + */ |
|
47 | 50 | public function addEntityType($name, $accessType = "Public", $summary = null, $longDescription = null) |
48 | 51 | { |
49 | 52 | $this->startEdmxTransaction(); |
@@ -121,6 +124,11 @@ discard block |
||
121 | 124 | $this->oldEdmx = null; |
122 | 125 | } |
123 | 126 | |
127 | + /** |
|
128 | + * @param string $name |
|
129 | + * @param string $type |
|
130 | + * @param string $storeGeneratedPattern |
|
131 | + */ |
|
124 | 132 | public function addPropertyToEntityType( |
125 | 133 | $entityType, |
126 | 134 | $name, |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | if (!$this->V3Edmx->isOK($msg)) { |
28 | 28 | throw new \Exception($msg); |
29 | 29 | } |
30 | - $ymlDir = __DIR__ . DIRECTORY_SEPARATOR . "MetadataV3" . DIRECTORY_SEPARATOR . "JMSmetadata"; |
|
30 | + $ymlDir = __DIR__.DIRECTORY_SEPARATOR."MetadataV3".DIRECTORY_SEPARATOR."JMSmetadata"; |
|
31 | 31 | $this->serializer = |
32 | 32 | SerializerBuilder::create() |
33 | 33 | ->addMetadataDir($ymlDir) |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | if (0 == strlen(trim($namespace))) { |
63 | 63 | $entityTypeName = $NewEntity->getName(); |
64 | 64 | } else { |
65 | - $entityTypeName = $namespace . "." . $NewEntity->getName(); |
|
65 | + $entityTypeName = $namespace.".".$NewEntity->getName(); |
|
66 | 66 | } |
67 | 67 | $entitySet->setEntityType($entityTypeName); |
68 | 68 | $entitySet->setGetterAccess($accessType); |
@@ -103,11 +103,11 @@ discard block |
||
103 | 103 | $last_letter = strtolower($singular[strlen($singular) - 1]); |
104 | 104 | switch ($last_letter) { |
105 | 105 | case 'y': |
106 | - return substr($singular, 0, -1) . 'ies'; |
|
106 | + return substr($singular, 0, -1).'ies'; |
|
107 | 107 | case 's': |
108 | - return $singular . 'es'; |
|
108 | + return $singular.'es'; |
|
109 | 109 | default: |
110 | - return $singular . 's'; |
|
110 | + return $singular.'s'; |
|
111 | 111 | } |
112 | 112 | } |
113 | 113 | |
@@ -189,17 +189,17 @@ discard block |
||
189 | 189 | ) |
190 | 190 | { |
191 | 191 | $association = new TAssociationType(); |
192 | - $name = $principalType . "_" . $principalProperty . "_" . $dependentType . "_" . $dependentProperty; |
|
192 | + $name = $principalType."_".$principalProperty."_".$dependentType."_".$dependentProperty; |
|
193 | 193 | $name = trim($name, "_"); |
194 | 194 | $association->setName($name); |
195 | 195 | |
196 | 196 | $principalEnd = new TAssociationEndType(); |
197 | 197 | $principalEnd->setType($principalType); |
198 | - $principalEnd->setRole($principalType . "_" . $principalProperty . "_" . $dependentType); |
|
198 | + $principalEnd->setRole($principalType."_".$principalProperty."_".$dependentType); |
|
199 | 199 | $principalEnd->setMultiplicity($principalMultiplicity); |
200 | 200 | $dependentEnd = new TAssociationEndType(); |
201 | 201 | $dependentEnd->setType($dependentType); |
202 | - $dependentEnd->setRole($dependentType . "_" . $dependentProperty . "_" . $principalType); |
|
202 | + $dependentEnd->setRole($dependentType."_".$dependentProperty."_".$principalType); |
|
203 | 203 | $dependentEnd->setMultiplicity($dependentMultiplicity); |
204 | 204 | $association->addToEnd($principalEnd); |
205 | 205 | $association->addToEnd($dependentEnd); |
@@ -207,14 +207,14 @@ discard block |
||
207 | 207 | $dependentReferralConstraint = null; |
208 | 208 | if (null != $principalConstraintProperty && 0 < count($principalConstraintProperty)) { |
209 | 209 | $principalReferralConstraint = new TReferentialConstraintRoleElementType(); |
210 | - $principalReferralConstraint->setRole($principalType . "_" . $principalProperty . "_" . $dependentType); |
|
210 | + $principalReferralConstraint->setRole($principalType."_".$principalProperty."_".$dependentType); |
|
211 | 211 | foreach ($principalConstraintProperty as $pripertyRef) { |
212 | 212 | $principalReferralConstraint->addToPropertyRef($pripertyRef); |
213 | 213 | } |
214 | 214 | } |
215 | 215 | if (null != $dependentConstraintProperty && 0 < count($dependentConstraintProperty)) { |
216 | 216 | $dependentReferralConstraint = new TReferentialConstraintRoleElementType(); |
217 | - $dependentReferralConstraint->setRole($dependentType . "_" . $dependentProperty . "_" . $principalType); |
|
217 | + $dependentReferralConstraint->setRole($dependentType."_".$dependentProperty."_".$principalType); |
|
218 | 218 | foreach ($dependentConstraintProperty as $pripertyRef) { |
219 | 219 | $dependentReferralConstraint->addToPropertyRef($pripertyRef); |
220 | 220 | } |
@@ -126,7 +126,7 @@ |
||
126 | 126 | die($this->getNamespace()); |
127 | 127 | return false; |
128 | 128 | }*/ |
129 | - $eSetType = str_replace($this->getNamespace() . ".", "", $eSetType); |
|
129 | + $eSetType = str_replace($this->getNamespace().".", "", $eSetType); |
|
130 | 130 | if (!in_array($eSetType, $entityTypeNames)) { |
131 | 131 | $msg = "entitySet Types should have a matching type name in entity Types"; |
132 | 132 | return false; |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $ds = DIRECTORY_SEPARATOR; |
31 | 31 | $xml = new \DOMDocument(); |
32 | 32 | $xml->loadXML($data); |
33 | - $xml->schemaValidate(dirname(__DIR__) . $ds . "xsd" . $ds . "/Microsoft.Data.Entity.Design.Edmx_3.xsd"); |
|
33 | + $xml->schemaValidate(dirname(__DIR__).$ds."xsd".$ds."/Microsoft.Data.Entity.Design.Edmx_3.xsd"); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | public function testEntitysAndProperties() |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $metadataManager = new MetadataManager(); |
39 | 39 | |
40 | 40 | $eType = $metadataManager->addEntityType("Category"); |
41 | - $this->assertNotFalse($eType, "Etype is false not type " . $metadataManager->getLastError()); |
|
41 | + $this->assertNotFalse($eType, "Etype is false not type ".$metadataManager->getLastError()); |
|
42 | 42 | $metadataManager->addPropertyToEntityType($eType, "CategoryID", "Int32", null, false, true, "Identity"); |
43 | 43 | $metadataManager->addPropertyToEntityType($eType, "CategoryName", "String"); |
44 | 44 | $metadataManager->addPropertyToEntityType($eType, "Description", "String"); |