@@ -52,6 +52,6 @@ |
||
| 52 | 52 | |
| 53 | 53 | $this->identifier = $identifier; |
| 54 | 54 | $this->entityClass = $entityClass; |
| 55 | - $this->hash = str_replace('\\', '.', strtolower($entityClass) . '_' . implode(' ', $identifier)); |
|
| 55 | + $this->hash = str_replace('\\', '.', strtolower($entityClass).'_'.implode(' ', $identifier)); |
|
| 56 | 56 | } |
| 57 | 57 | } |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | public function __construct($value, $time = null) |
| 46 | 46 | { |
| 47 | 47 | $this->value = $value; |
| 48 | - $this->time = $time ? : time(); |
|
| 48 | + $this->time = $time ?: time(); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -93,7 +93,7 @@ |
||
| 93 | 93 | return $this->collection->isEmpty(); |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | - return !$this->count(); |
|
| 96 | + return ! $this->count(); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | /** |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | */ |
| 47 | 47 | public static function namedQueryNotFound($queryName) |
| 48 | 48 | { |
| 49 | - return new self('Could not find a named query by the name "' . $queryName . '"'); |
|
| 49 | + return new self('Could not find a named query by the name "'.$queryName.'"'); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | /** |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | public static function namedNativeQueryNotFound($nativeQueryName) |
| 58 | 58 | { |
| 59 | - return new self('Could not find a named native query by the name "' . $nativeQueryName . '"'); |
|
| 59 | + return new self('Could not find a named native query by the name "'.$nativeQueryName.'"'); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /** |
@@ -68,10 +68,10 @@ discard block |
||
| 68 | 68 | public static function entityMissingForeignAssignedId($entity, $relatedEntity) |
| 69 | 69 | { |
| 70 | 70 | return new self( |
| 71 | - "Entity of type " . get_class($entity) . " has identity through a foreign entity " . get_class($relatedEntity) . ", " . |
|
| 72 | - "however this entity has no identity itself. You have to call EntityManager#persist() on the related entity " . |
|
| 73 | - "and make sure that an identifier was generated before trying to persist '" . get_class($entity) . "'. In case " . |
|
| 74 | - "of Post Insert ID Generation (such as MySQL Auto-Increment) this means you have to call " . |
|
| 71 | + "Entity of type ".get_class($entity)." has identity through a foreign entity ".get_class($relatedEntity).", ". |
|
| 72 | + "however this entity has no identity itself. You have to call EntityManager#persist() on the related entity ". |
|
| 73 | + "and make sure that an identifier was generated before trying to persist '".get_class($entity)."'. In case ". |
|
| 74 | + "of Post Insert ID Generation (such as MySQL Auto-Increment) this means you have to call ". |
|
| 75 | 75 | "EntityManager#flush() between both persist operations." |
| 76 | 76 | ); |
| 77 | 77 | } |
@@ -84,9 +84,9 @@ discard block |
||
| 84 | 84 | */ |
| 85 | 85 | public static function entityMissingAssignedIdForField($entity, $field) |
| 86 | 86 | { |
| 87 | - return new self("Entity of type " . get_class($entity) . " is missing an assigned ID for field '" . $field . "'. " . |
|
| 87 | + return new self("Entity of type ".get_class($entity)." is missing an assigned ID for field '".$field."'. ". |
|
| 88 | 88 | "The identifier generation strategy for this entity requires the ID field to be populated before ". |
| 89 | - "EntityManager#persist() is called. If you want automatically generated identifiers instead " . |
|
| 89 | + "EntityManager#persist() is called. If you want automatically generated identifiers instead ". |
|
| 90 | 90 | "you need to adjust the metadata mapping accordingly." |
| 91 | 91 | ); |
| 92 | 92 | } |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | */ |
| 124 | 124 | public static function invalidOrientation($className, $field) |
| 125 | 125 | { |
| 126 | - return new self("Invalid order by orientation specified for " . $className . "#" . $field); |
|
| 126 | + return new self("Invalid order by orientation specified for ".$className."#".$field); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | /** |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | */ |
| 241 | 241 | public static function queryCacheUsesNonPersistentCache(CacheDriver $cache) |
| 242 | 242 | { |
| 243 | - return new self('Query Cache uses a non-persistent cache driver, ' . get_class($cache) . '.'); |
|
| 243 | + return new self('Query Cache uses a non-persistent cache driver, '.get_class($cache).'.'); |
|
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | /** |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | */ |
| 251 | 251 | public static function metadataCacheUsesNonPersistentCache(CacheDriver $cache) |
| 252 | 252 | { |
| 253 | - return new self('Metadata Cache uses a non-persistent cache driver, ' . get_class($cache) . '.'); |
|
| 253 | + return new self('Metadata Cache uses a non-persistent cache driver, '.get_class($cache).'.'); |
|
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | /** |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | */ |
| 292 | 292 | public static function missingIdentifierField($className, $fieldName) |
| 293 | 293 | { |
| 294 | - return new self("The identifier $fieldName is missing for a query of " . $className); |
|
| 294 | + return new self("The identifier $fieldName is missing for a query of ".$className); |
|
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | /** |
@@ -303,8 +303,8 @@ discard block |
||
| 303 | 303 | public static function unrecognizedIdentifierFields($className, $fieldNames) |
| 304 | 304 | { |
| 305 | 305 | return new self( |
| 306 | - "Unrecognized identifier fields: '" . implode("', '", $fieldNames) . "' " . |
|
| 307 | - "are not present on class '" . $className . "'." |
|
| 306 | + "Unrecognized identifier fields: '".implode("', '", $fieldNames)."' ". |
|
| 307 | + "are not present on class '".$className."'." |
|
| 308 | 308 | ); |
| 309 | 309 | } |
| 310 | 310 | |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | public static function schemaToolFailure($sql, \Exception $e) |
| 38 | 38 | { |
| 39 | - return new self("Schema-Tool failed with Error '" . $e->getMessage() . "' while executing DDL: " . $sql, "0", $e); |
|
| 39 | + return new self("Schema-Tool failed with Error '".$e->getMessage()."' while executing DDL: ".$sql, "0", $e); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | /** |
@@ -87,42 +87,42 @@ |
||
| 87 | 87 | |
| 88 | 88 | fwrite($fh, "Flush Operation [".$this->context."] - Dumping identity map:\n"); |
| 89 | 89 | foreach ($identityMap as $className => $map) { |
| 90 | - fwrite($fh, "Class: ". $className . "\n"); |
|
| 90 | + fwrite($fh, "Class: ".$className."\n"); |
|
| 91 | 91 | |
| 92 | 92 | foreach ($map as $entity) { |
| 93 | - fwrite($fh, " Entity: " . $this->getIdString($entity, $uow) . " " . spl_object_hash($entity)."\n"); |
|
| 93 | + fwrite($fh, " Entity: ".$this->getIdString($entity, $uow)." ".spl_object_hash($entity)."\n"); |
|
| 94 | 94 | fwrite($fh, " Associations:\n"); |
| 95 | 95 | |
| 96 | 96 | $cm = $em->getClassMetadata($className); |
| 97 | 97 | |
| 98 | 98 | foreach ($cm->associationMappings as $field => $assoc) { |
| 99 | - fwrite($fh, " " . $field . " "); |
|
| 99 | + fwrite($fh, " ".$field." "); |
|
| 100 | 100 | $value = $cm->getFieldValue($entity, $field); |
| 101 | 101 | |
| 102 | 102 | if ($assoc['type'] & ClassMetadata::TO_ONE) { |
| 103 | 103 | if ($value === null) { |
| 104 | 104 | fwrite($fh, " NULL\n"); |
| 105 | 105 | } else { |
| 106 | - if ($value instanceof Proxy && !$value->__isInitialized()) { |
|
| 106 | + if ($value instanceof Proxy && ! $value->__isInitialized()) { |
|
| 107 | 107 | fwrite($fh, "[PROXY] "); |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - fwrite($fh, $this->getIdString($value, $uow) . " " . spl_object_hash($value) . "\n"); |
|
| 110 | + fwrite($fh, $this->getIdString($value, $uow)." ".spl_object_hash($value)."\n"); |
|
| 111 | 111 | } |
| 112 | 112 | } else { |
| 113 | - $initialized = !($value instanceof PersistentCollection) || $value->isInitialized(); |
|
| 113 | + $initialized = ! ($value instanceof PersistentCollection) || $value->isInitialized(); |
|
| 114 | 114 | if ($value === null) { |
| 115 | 115 | fwrite($fh, " NULL\n"); |
| 116 | 116 | } elseif ($initialized) { |
| 117 | - fwrite($fh, "[INITIALIZED] " . $this->getType($value). " " . count($value) . " elements\n"); |
|
| 117 | + fwrite($fh, "[INITIALIZED] ".$this->getType($value)." ".count($value)." elements\n"); |
|
| 118 | 118 | |
| 119 | 119 | foreach ($value as $obj) { |
| 120 | - fwrite($fh, " " . $this->getIdString($obj, $uow) . " " . spl_object_hash($obj)."\n"); |
|
| 120 | + fwrite($fh, " ".$this->getIdString($obj, $uow)." ".spl_object_hash($obj)."\n"); |
|
| 121 | 121 | } |
| 122 | 122 | } else { |
| 123 | - fwrite($fh, "[PROXY] " . $this->getType($value) . " unknown element size\n"); |
|
| 123 | + fwrite($fh, "[PROXY] ".$this->getType($value)." unknown element size\n"); |
|
| 124 | 124 | foreach ($value->unwrap() as $obj) { |
| 125 | - fwrite($fh, " " . $this->getIdString($obj, $uow) . " " . spl_object_hash($obj)."\n"); |
|
| 125 | + fwrite($fh, " ".$this->getIdString($obj, $uow)." ".spl_object_hash($obj)."\n"); |
|
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | 128 | } |
@@ -143,7 +143,7 @@ |
||
| 143 | 143 | $code = $this->generateEntityRepositoryClass($fullClassName); |
| 144 | 144 | |
| 145 | 145 | $path = $outputDirectory . DIRECTORY_SEPARATOR |
| 146 | - . str_replace('\\', \DIRECTORY_SEPARATOR, $fullClassName) . '.php'; |
|
| 146 | + . str_replace('\\', \DIRECTORY_SEPARATOR, $fullClassName) . '.php'; |
|
| 147 | 147 | $dir = dirname($path); |
| 148 | 148 | |
| 149 | 149 | if ( ! is_dir($dir)) { |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | { |
| 112 | 112 | $namespace = $this->getClassNamespace($fullClassName); |
| 113 | 113 | |
| 114 | - return $namespace ? 'namespace ' . $namespace . ';' : ''; |
|
| 114 | + return $namespace ? 'namespace '.$namespace.';' : ''; |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | /** |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | $repositoryName = $this->repositoryName ?: 'Doctrine\ORM\EntityRepository'; |
| 127 | 127 | |
| 128 | 128 | if ($namespace && $repositoryName[0] !== '\\') { |
| 129 | - $repositoryName = '\\' . $repositoryName; |
|
| 129 | + $repositoryName = '\\'.$repositoryName; |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | return $repositoryName; |
@@ -142,8 +142,8 @@ discard block |
||
| 142 | 142 | { |
| 143 | 143 | $code = $this->generateEntityRepositoryClass($fullClassName); |
| 144 | 144 | |
| 145 | - $path = $outputDirectory . DIRECTORY_SEPARATOR |
|
| 146 | - . str_replace('\\', \DIRECTORY_SEPARATOR, $fullClassName) . '.php'; |
|
| 145 | + $path = $outputDirectory.DIRECTORY_SEPARATOR |
|
| 146 | + . str_replace('\\', \DIRECTORY_SEPARATOR, $fullClassName).'.php'; |
|
| 147 | 147 | $dir = dirname($path); |
| 148 | 148 | |
| 149 | 149 | if ( ! is_dir($dir)) { |
@@ -89,66 +89,66 @@ discard block |
||
| 89 | 89 | $cmf = $this->em->getMetadataFactory(); |
| 90 | 90 | |
| 91 | 91 | foreach ($class->fieldMappings as $fieldName => $mapping) { |
| 92 | - if (!Type::hasType($mapping['type'])) { |
|
| 93 | - $ce[] = "The field '" . $class->name . "#" . $fieldName."' uses a non-existant type '" . $mapping['type'] . "'."; |
|
| 92 | + if ( ! Type::hasType($mapping['type'])) { |
|
| 93 | + $ce[] = "The field '".$class->name."#".$fieldName."' uses a non-existant type '".$mapping['type']."'."; |
|
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | foreach ($class->associationMappings as $fieldName => $assoc) { |
| 98 | - if (!class_exists($assoc['targetEntity']) || $cmf->isTransient($assoc['targetEntity'])) { |
|
| 99 | - $ce[] = "The target entity '" . $assoc['targetEntity'] . "' specified on " . $class->name . '#' . $fieldName . ' is unknown or not an entity.'; |
|
| 98 | + if ( ! class_exists($assoc['targetEntity']) || $cmf->isTransient($assoc['targetEntity'])) { |
|
| 99 | + $ce[] = "The target entity '".$assoc['targetEntity']."' specified on ".$class->name.'#'.$fieldName.' is unknown or not an entity.'; |
|
| 100 | 100 | |
| 101 | 101 | return $ce; |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | if ($assoc['mappedBy'] && $assoc['inversedBy']) { |
| 105 | - $ce[] = "The association " . $class . "#" . $fieldName . " cannot be defined as both inverse and owning."; |
|
| 105 | + $ce[] = "The association ".$class."#".$fieldName." cannot be defined as both inverse and owning."; |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | $targetMetadata = $cmf->getMetadataFor($assoc['targetEntity']); |
| 109 | 109 | |
| 110 | 110 | if (isset($assoc['id']) && $targetMetadata->containsForeignIdentifier) { |
| 111 | - $ce[] = "Cannot map association '" . $class->name. "#". $fieldName ." as identifier, because " . |
|
| 112 | - "the target entity '". $targetMetadata->name . "' also maps an association as identifier."; |
|
| 111 | + $ce[] = "Cannot map association '".$class->name."#".$fieldName." as identifier, because ". |
|
| 112 | + "the target entity '".$targetMetadata->name."' also maps an association as identifier."; |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | if ($assoc['mappedBy']) { |
| 116 | 116 | if ($targetMetadata->hasField($assoc['mappedBy'])) { |
| 117 | - $ce[] = "The association " . $class->name . "#" . $fieldName . " refers to the owning side ". |
|
| 118 | - "field " . $assoc['targetEntity'] . "#" . $assoc['mappedBy'] . " which is not defined as association, but as field."; |
|
| 117 | + $ce[] = "The association ".$class->name."#".$fieldName." refers to the owning side ". |
|
| 118 | + "field ".$assoc['targetEntity']."#".$assoc['mappedBy']." which is not defined as association, but as field."; |
|
| 119 | 119 | } |
| 120 | - if (!$targetMetadata->hasAssociation($assoc['mappedBy'])) { |
|
| 121 | - $ce[] = "The association " . $class->name . "#" . $fieldName . " refers to the owning side ". |
|
| 122 | - "field " . $assoc['targetEntity'] . "#" . $assoc['mappedBy'] . " which does not exist."; |
|
| 120 | + if ( ! $targetMetadata->hasAssociation($assoc['mappedBy'])) { |
|
| 121 | + $ce[] = "The association ".$class->name."#".$fieldName." refers to the owning side ". |
|
| 122 | + "field ".$assoc['targetEntity']."#".$assoc['mappedBy']." which does not exist."; |
|
| 123 | 123 | } elseif ($targetMetadata->associationMappings[$assoc['mappedBy']]['inversedBy'] == null) { |
| 124 | - $ce[] = "The field " . $class->name . "#" . $fieldName . " is on the inverse side of a ". |
|
| 124 | + $ce[] = "The field ".$class->name."#".$fieldName." is on the inverse side of a ". |
|
| 125 | 125 | "bi-directional relationship, but the specified mappedBy association on the target-entity ". |
| 126 | - $assoc['targetEntity'] . "#" . $assoc['mappedBy'] . " does not contain the required ". |
|
| 127 | - "'inversedBy=\"" . $fieldName . "\"' attribute."; |
|
| 126 | + $assoc['targetEntity']."#".$assoc['mappedBy']." does not contain the required ". |
|
| 127 | + "'inversedBy=\"".$fieldName."\"' attribute."; |
|
| 128 | 128 | } elseif ($targetMetadata->associationMappings[$assoc['mappedBy']]['inversedBy'] != $fieldName) { |
| 129 | - $ce[] = "The mappings " . $class->name . "#" . $fieldName . " and " . |
|
| 130 | - $assoc['targetEntity'] . "#" . $assoc['mappedBy'] . " are ". |
|
| 129 | + $ce[] = "The mappings ".$class->name."#".$fieldName." and ". |
|
| 130 | + $assoc['targetEntity']."#".$assoc['mappedBy']." are ". |
|
| 131 | 131 | "inconsistent with each other."; |
| 132 | 132 | } |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | if ($assoc['inversedBy']) { |
| 136 | 136 | if ($targetMetadata->hasField($assoc['inversedBy'])) { |
| 137 | - $ce[] = "The association " . $class->name . "#" . $fieldName . " refers to the inverse side ". |
|
| 138 | - "field " . $assoc['targetEntity'] . "#" . $assoc['inversedBy'] . " which is not defined as association."; |
|
| 137 | + $ce[] = "The association ".$class->name."#".$fieldName." refers to the inverse side ". |
|
| 138 | + "field ".$assoc['targetEntity']."#".$assoc['inversedBy']." which is not defined as association."; |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | - if (!$targetMetadata->hasAssociation($assoc['inversedBy'])) { |
|
| 142 | - $ce[] = "The association " . $class->name . "#" . $fieldName . " refers to the inverse side ". |
|
| 143 | - "field " . $assoc['targetEntity'] . "#" . $assoc['inversedBy'] . " which does not exist."; |
|
| 141 | + if ( ! $targetMetadata->hasAssociation($assoc['inversedBy'])) { |
|
| 142 | + $ce[] = "The association ".$class->name."#".$fieldName." refers to the inverse side ". |
|
| 143 | + "field ".$assoc['targetEntity']."#".$assoc['inversedBy']." which does not exist."; |
|
| 144 | 144 | } elseif ($targetMetadata->associationMappings[$assoc['inversedBy']]['mappedBy'] == null) { |
| 145 | - $ce[] = "The field " . $class->name . "#" . $fieldName . " is on the owning side of a ". |
|
| 145 | + $ce[] = "The field ".$class->name."#".$fieldName." is on the owning side of a ". |
|
| 146 | 146 | "bi-directional relationship, but the specified mappedBy association on the target-entity ". |
| 147 | - $assoc['targetEntity'] . "#" . $assoc['mappedBy'] . " does not contain the required ". |
|
| 147 | + $assoc['targetEntity']."#".$assoc['mappedBy']." does not contain the required ". |
|
| 148 | 148 | "'inversedBy' attribute."; |
| 149 | 149 | } elseif ($targetMetadata->associationMappings[$assoc['inversedBy']]['mappedBy'] != $fieldName) { |
| 150 | - $ce[] = "The mappings " . $class->name . "#" . $fieldName . " and " . |
|
| 151 | - $assoc['targetEntity'] . "#" . $assoc['inversedBy'] . " are ". |
|
| 150 | + $ce[] = "The mappings ".$class->name."#".$fieldName." and ". |
|
| 151 | + $assoc['targetEntity']."#".$assoc['inversedBy']." are ". |
|
| 152 | 152 | "inconsistent with each other."; |
| 153 | 153 | } |
| 154 | 154 | |
@@ -156,14 +156,14 @@ discard block |
||
| 156 | 156 | if (array_key_exists($assoc['inversedBy'], $targetMetadata->associationMappings)) { |
| 157 | 157 | $targetAssoc = $targetMetadata->associationMappings[$assoc['inversedBy']]; |
| 158 | 158 | if ($assoc['type'] == ClassMetadataInfo::ONE_TO_ONE && $targetAssoc['type'] !== ClassMetadataInfo::ONE_TO_ONE) { |
| 159 | - $ce[] = "If association " . $class->name . "#" . $fieldName . " is one-to-one, then the inversed " . |
|
| 160 | - "side " . $targetMetadata->name . "#" . $assoc['inversedBy'] . " has to be one-to-one as well."; |
|
| 159 | + $ce[] = "If association ".$class->name."#".$fieldName." is one-to-one, then the inversed ". |
|
| 160 | + "side ".$targetMetadata->name."#".$assoc['inversedBy']." has to be one-to-one as well."; |
|
| 161 | 161 | } elseif ($assoc['type'] == ClassMetadataInfo::MANY_TO_ONE && $targetAssoc['type'] !== ClassMetadataInfo::ONE_TO_MANY) { |
| 162 | - $ce[] = "If association " . $class->name . "#" . $fieldName . " is many-to-one, then the inversed " . |
|
| 163 | - "side " . $targetMetadata->name . "#" . $assoc['inversedBy'] . " has to be one-to-many."; |
|
| 162 | + $ce[] = "If association ".$class->name."#".$fieldName." is many-to-one, then the inversed ". |
|
| 163 | + "side ".$targetMetadata->name."#".$assoc['inversedBy']." has to be one-to-many."; |
|
| 164 | 164 | } elseif ($assoc['type'] == ClassMetadataInfo::MANY_TO_MANY && $targetAssoc['type'] !== ClassMetadataInfo::MANY_TO_MANY) { |
| 165 | - $ce[] = "If association " . $class->name . "#" . $fieldName . " is many-to-many, then the inversed " . |
|
| 166 | - "side " . $targetMetadata->name . "#" . $assoc['inversedBy'] . " has to be many-to-many as well."; |
|
| 165 | + $ce[] = "If association ".$class->name."#".$fieldName." is many-to-many, then the inversed ". |
|
| 166 | + "side ".$targetMetadata->name."#".$assoc['inversedBy']." has to be many-to-many as well."; |
|
| 167 | 167 | } |
| 168 | 168 | } |
| 169 | 169 | } |
@@ -172,8 +172,8 @@ discard block |
||
| 172 | 172 | if ($assoc['type'] == ClassMetadataInfo::MANY_TO_MANY) { |
| 173 | 173 | $identifierColumns = $class->getIdentifierColumnNames(); |
| 174 | 174 | foreach ($assoc['joinTable']['joinColumns'] as $joinColumn) { |
| 175 | - if (!in_array($joinColumn['referencedColumnName'], $identifierColumns)) { |
|
| 176 | - $ce[] = "The referenced column name '" . $joinColumn['referencedColumnName'] . "' " . |
|
| 175 | + if ( ! in_array($joinColumn['referencedColumnName'], $identifierColumns)) { |
|
| 176 | + $ce[] = "The referenced column name '".$joinColumn['referencedColumnName']."' ". |
|
| 177 | 177 | "has to be a primary key column on the target entity class '".$class->name."'."; |
| 178 | 178 | break; |
| 179 | 179 | } |
@@ -181,32 +181,32 @@ discard block |
||
| 181 | 181 | |
| 182 | 182 | $identifierColumns = $targetMetadata->getIdentifierColumnNames(); |
| 183 | 183 | foreach ($assoc['joinTable']['inverseJoinColumns'] as $inverseJoinColumn) { |
| 184 | - if (!in_array($inverseJoinColumn['referencedColumnName'], $identifierColumns)) { |
|
| 185 | - $ce[] = "The referenced column name '" . $joinColumn['referencedColumnName'] . "' " . |
|
| 184 | + if ( ! in_array($inverseJoinColumn['referencedColumnName'], $identifierColumns)) { |
|
| 185 | + $ce[] = "The referenced column name '".$joinColumn['referencedColumnName']."' ". |
|
| 186 | 186 | "has to be a primary key column on the target entity class '".$targetMetadata->name."'."; |
| 187 | 187 | break; |
| 188 | 188 | } |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | if (count($targetMetadata->getIdentifierColumnNames()) != count($assoc['joinTable']['inverseJoinColumns'])) { |
| 192 | - $ce[] = "The inverse join columns of the many-to-many table '" . $assoc['joinTable']['name'] . "' " . |
|
| 193 | - "have to contain to ALL identifier columns of the target entity '". $targetMetadata->name . "', " . |
|
| 194 | - "however '" . implode(", ", array_diff($targetMetadata->getIdentifierColumnNames(), array_values($assoc['relationToTargetKeyColumns']))) . |
|
| 192 | + $ce[] = "The inverse join columns of the many-to-many table '".$assoc['joinTable']['name']."' ". |
|
| 193 | + "have to contain to ALL identifier columns of the target entity '".$targetMetadata->name."', ". |
|
| 194 | + "however '".implode(", ", array_diff($targetMetadata->getIdentifierColumnNames(), array_values($assoc['relationToTargetKeyColumns']))). |
|
| 195 | 195 | "' are missing."; |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | if (count($class->getIdentifierColumnNames()) != count($assoc['joinTable']['joinColumns'])) { |
| 199 | - $ce[] = "The join columns of the many-to-many table '" . $assoc['joinTable']['name'] . "' " . |
|
| 200 | - "have to contain to ALL identifier columns of the source entity '". $class->name . "', " . |
|
| 201 | - "however '" . implode(", ", array_diff($class->getIdentifierColumnNames(), array_values($assoc['relationToSourceKeyColumns']))) . |
|
| 199 | + $ce[] = "The join columns of the many-to-many table '".$assoc['joinTable']['name']."' ". |
|
| 200 | + "have to contain to ALL identifier columns of the source entity '".$class->name."', ". |
|
| 201 | + "however '".implode(", ", array_diff($class->getIdentifierColumnNames(), array_values($assoc['relationToSourceKeyColumns']))). |
|
| 202 | 202 | "' are missing."; |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | } elseif ($assoc['type'] & ClassMetadataInfo::TO_ONE) { |
| 206 | 206 | $identifierColumns = $targetMetadata->getIdentifierColumnNames(); |
| 207 | 207 | foreach ($assoc['joinColumns'] as $joinColumn) { |
| 208 | - if (!in_array($joinColumn['referencedColumnName'], $identifierColumns)) { |
|
| 209 | - $ce[] = "The referenced column name '" . $joinColumn['referencedColumnName'] . "' " . |
|
| 208 | + if ( ! in_array($joinColumn['referencedColumnName'], $identifierColumns)) { |
|
| 209 | + $ce[] = "The referenced column name '".$joinColumn['referencedColumnName']."' ". |
|
| 210 | 210 | "has to be a primary key column on the target entity class '".$targetMetadata->name."'."; |
| 211 | 211 | } |
| 212 | 212 | } |
@@ -218,9 +218,9 @@ discard block |
||
| 218 | 218 | $ids[] = $joinColumn['name']; |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | - $ce[] = "The join columns of the association '" . $assoc['fieldName'] . "' " . |
|
| 222 | - "have to match to ALL identifier columns of the target entity '". $targetMetadata->name . "', " . |
|
| 223 | - "however '" . implode(", ", array_diff($targetMetadata->getIdentifierColumnNames(), $ids)) . |
|
| 221 | + $ce[] = "The join columns of the association '".$assoc['fieldName']."' ". |
|
| 222 | + "have to match to ALL identifier columns of the target entity '".$targetMetadata->name."', ". |
|
| 223 | + "however '".implode(", ", array_diff($targetMetadata->getIdentifierColumnNames(), $ids)). |
|
| 224 | 224 | "' are missing."; |
| 225 | 225 | } |
| 226 | 226 | } |
@@ -228,19 +228,19 @@ discard block |
||
| 228 | 228 | |
| 229 | 229 | if (isset($assoc['orderBy']) && $assoc['orderBy'] !== null) { |
| 230 | 230 | foreach ($assoc['orderBy'] as $orderField => $orientation) { |
| 231 | - if (!$targetMetadata->hasField($orderField) && !$targetMetadata->hasAssociation($orderField)) { |
|
| 232 | - $ce[] = "The association " . $class->name."#".$fieldName." is ordered by a foreign field " . |
|
| 233 | - $orderField . " that is not a field on the target entity " . $targetMetadata->name . "."; |
|
| 231 | + if ( ! $targetMetadata->hasField($orderField) && ! $targetMetadata->hasAssociation($orderField)) { |
|
| 232 | + $ce[] = "The association ".$class->name."#".$fieldName." is ordered by a foreign field ". |
|
| 233 | + $orderField." that is not a field on the target entity ".$targetMetadata->name."."; |
|
| 234 | 234 | continue; |
| 235 | 235 | } |
| 236 | 236 | if ($targetMetadata->isCollectionValuedAssociation($orderField)) { |
| 237 | - $ce[] = "The association " . $class->name."#".$fieldName." is ordered by a field " . |
|
| 238 | - $orderField . " on " . $targetMetadata->name . " that is a collection-valued association."; |
|
| 237 | + $ce[] = "The association ".$class->name."#".$fieldName." is ordered by a field ". |
|
| 238 | + $orderField." on ".$targetMetadata->name." that is a collection-valued association."; |
|
| 239 | 239 | continue; |
| 240 | 240 | } |
| 241 | 241 | if ($targetMetadata->isAssociationInverseSide($orderField)) { |
| 242 | - $ce[] = "The association " . $class->name."#".$fieldName." is ordered by a field " . |
|
| 243 | - $orderField . " on " . $targetMetadata->name . " that is the inverse side of an association."; |
|
| 242 | + $ce[] = "The association ".$class->name."#".$fieldName." is ordered by a field ". |
|
| 243 | + $orderField." on ".$targetMetadata->name." that is the inverse side of an association."; |
|
| 244 | 244 | continue; |
| 245 | 245 | } |
| 246 | 246 | } |
@@ -248,9 +248,9 @@ discard block |
||
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | foreach ($class->subClasses as $subClass) { |
| 251 | - if (!in_array($class->name, class_parents($subClass))) { |
|
| 252 | - $ce[] = "According to the discriminator map class '" . $subClass . "' has to be a child ". |
|
| 253 | - "of '" . $class->name . "' but these entities are not related through inheritance."; |
|
| 251 | + if ( ! in_array($class->name, class_parents($subClass))) { |
|
| 252 | + $ce[] = "According to the discriminator map class '".$subClass."' has to be a child ". |
|
| 253 | + "of '".$class->name."' but these entities are not related through inheritance."; |
|
| 254 | 254 | } |
| 255 | 255 | } |
| 256 | 256 | |
@@ -44,14 +44,14 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public static function registerAutoloadDirectory($directory) |
| 46 | 46 | { |
| 47 | - if (!class_exists('Doctrine\Common\ClassLoader', false)) { |
|
| 48 | - require_once $directory . "/Doctrine/Common/ClassLoader.php"; |
|
| 47 | + if ( ! class_exists('Doctrine\Common\ClassLoader', false)) { |
|
| 48 | + require_once $directory."/Doctrine/Common/ClassLoader.php"; |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | $loader = new ClassLoader("Doctrine", $directory); |
| 52 | 52 | $loader->register(); |
| 53 | 53 | |
| 54 | - $loader = new ClassLoader("Symfony\Component", $directory . "/Doctrine"); |
|
| 54 | + $loader = new ClassLoader("Symfony\Component", $directory."/Doctrine"); |
|
| 55 | 55 | $loader->register(); |
| 56 | 56 | } |
| 57 | 57 | |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | if ($cache instanceof CacheProvider) { |
| 149 | - $cache->setNamespace("dc2_" . md5($proxyDir) . "_"); // to avoid collisions |
|
| 149 | + $cache->setNamespace("dc2_".md5($proxyDir)."_"); // to avoid collisions |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | $config = new Configuration(); |