Skip to content

Commit

Permalink
[BUGFIX] Do not treat all classes as entities in ClassSchema
Browse files Browse the repository at this point in the history
The ClassSchema class has a property $modelType which indicates
that a class is either an entity or a value object. This property
has a default value that reflected the state of an entity.

This means, that all classes, class schemata are created for are
considered entities which then leads to the execution of further
entity related analysis code, such as looking for specific doc
blocks and/or annotations.

While this isn't an issue functionality wise, it can be in the future.
Also, the superfluous cpu cycles can and should be spared.

Releases: master, 9.5
Resolves: #87632
Change-Id: If4bc79b9761ee28ffd9e2f25924588140310c0fa
Reviewed-on: https://review.typo3.org/c/59792
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
  • Loading branch information
alexanderschnitzler authored and maddy2101 committed Feb 23, 2019
1 parent 45b72b2 commit fad6532
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion typo3/sysext/extbase/Classes/Reflection/ClassSchema.php
Expand Up @@ -57,7 +57,7 @@ class ClassSchema
*
* @var int
*/
protected $modelType = self::MODELTYPE_ENTITY;
protected $modelType = 0;

/**
* Whether a repository exists for the class this schema is referring to
Expand Down
Expand Up @@ -100,7 +100,12 @@ public function classSchemaGetProperties()
'propertyWithTransientAnnotation',
'propertyWithCascadeAnnotation',
'propertyWithCascadeAnnotationWithoutVarAnnotation',
'propertyWithObjectStorageAnnotation'
'propertyWithObjectStorageAnnotation',
'uid',
'_localizedUid',
'_languageUid',
'_versionedUid',
'pid',
],
array_keys((new ClassSchema(Fixture\DummyClassWithAllTypesOfProperties::class))->getProperties())
);
Expand Down
Expand Up @@ -16,11 +16,12 @@

use TYPO3\CMS\Extbase\Annotation as Extbase;
use TYPO3\CMS\Extbase\Annotation\ORM\Transient;
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;

/**
* Fixture class with getters and setters
*/
class DummyClassWithAllTypesOfProperties
class DummyClassWithAllTypesOfProperties extends AbstractEntity
{
public $publicProperty;

Expand Down

0 comments on commit fad6532

Please sign in to comment.