Jump to content

Reflection Class


Recommended Posts

Hi all.

I was reading the class "ObjectModel.php" and I found the following code.

Where is the Reflection class and who does?

public static function getDefinition($class, $field = null)
{
 $reflection = new ReflectionClass($class);
 $definition = $reflection->getStaticPropertyValue('definition');
 $definition['classname'] = $class;
 if (!empty($definition['multilang']))
  $definition['associations'][Collection::LANG_ALIAS] = array(
    'type' => self::HAS_MANY,
    'field' => $definition['primary'],
    'foreign_field' => $definition['primary'],
  );
 if ($field)
  return isset($definition['fields'][$field]) ? $definition['fields'][$field] : null;
 return $definition;
}

 

Thanks!

Link to comment
Share on other sites

×
×
  • Create New...