diff --git a/lib/Doctrine/ORM/Tools/SchemaValidator.php b/lib/Doctrine/ORM/Tools/SchemaValidator.php index 11910138e..276b447ec 100644 --- a/lib/Doctrine/ORM/Tools/SchemaValidator.php +++ b/lib/Doctrine/ORM/Tools/SchemaValidator.php @@ -236,20 +236,6 @@ class SchemaValidator } } - foreach ($class->reflClass->getProperties(\ReflectionProperty::IS_PUBLIC) as $publicAttr) { - if ($publicAttr->isStatic()) { - continue; - } - - if ( ! isset($class->fieldMappings[$publicAttr->getName()]) && - ! isset($class->associationMappings[$publicAttr->getName()])) { - continue; - } - - $ce[] = "Field '".$publicAttr->getName()."' in class '".$class->name."' must be private ". - "or protected. Public fields may break lazy-loading."; - } - foreach ($class->subClasses as $subClass) { if (!in_array($class->name, class_parents($subClass))) { $ce[] = "According to the discriminator map class '" . $subClass . "' has to be a child ". diff --git a/tests/Doctrine/Tests/ORM/Functional/SchemaValidatorTest.php b/tests/Doctrine/Tests/ORM/Functional/SchemaValidatorTest.php index a575db0c0..c09f336c9 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SchemaValidatorTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SchemaValidatorTest.php @@ -38,12 +38,6 @@ class SchemaValidatorTest extends \Doctrine\Tests\OrmFunctionalTestCase foreach ($classes as $class) { $ce = $validator->validateClass($class); - foreach ($ce as $key => $error) { - if (strpos($error, "must be private or protected. Public fields may break lazy-loading.") !== false) { - unset($ce[$key]); - } - } - $this->assertEquals(0, count($ce), "Invalid Modelset: " . $modelSet . " class " . $class->name . ": ". implode("\n", $ce)); } }