You are here

public function RuntimeReflectionService::getAccessibleProperty in Plug 7

Returns an accessible property (setAccessible(true)) or null.

Parameters

string $class:

string $property:

Return value

\ReflectionProperty|null

Overrides ReflectionService::getAccessibleProperty

File

lib/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php, line 78

Class

RuntimeReflectionService
PHP Runtime Reflection Service.

Namespace

Doctrine\Common\Persistence\Mapping

Code

public function getAccessibleProperty($class, $property) {
  $reflectionProperty = new ReflectionProperty($class, $property);
  if ($reflectionProperty
    ->isPublic()) {
    $reflectionProperty = new RuntimePublicReflectionProperty($class, $property);
  }
  $reflectionProperty
    ->setAccessible(true);
  return $reflectionProperty;
}