Esempio n. 1
0
 private function getPropertiesInstance($instance)
 {
     $properties = array();
     $ReflectionObject = new \ReflectionObject($instance);
     $ConnectionOptions = $this->getConnectionManager()->getConnectionOptions();
     $properties['prefix'] = $ConnectionOptions['prefix'];
     $properties['table'] = $ReflectionObject->hasConstant('table') ? $ConnectionOptions['prefix'] . $instance::table : null;
     $properties['primary'] = $ReflectionObject->hasConstant('primary') ? $instance::primary : null;
     $properties['title'] = $ReflectionObject->hasConstant('title') ? $instance::title : null;
     $properties['instance'] = $instance;
     $properties['namespace'] = get_class($instance);
     $properties['has_relation'] = $ReflectionObject->hasMethod('getDefinitionRelations') ? true : false;
     $properties['has_sluggable'] = $ReflectionObject->hasMethod('getFieldsSluggable') ? true : false;
     $properties['has_sluggable'] = $ReflectionObject->hasMethod('getFieldsSluggable') ? true : false;
     $properties['has_timestampable'] = $ReflectionObject->hasConstant('hasTimestampable') ? $instance::hasTimestampable : false;
     $properties['model_language'] = $ReflectionObject->hasConstant('modelLanguage') ? $instance::modelLanguage : false;
     $properties['model_translation'] = $ReflectionObject->hasConstant('modelTranslation') ? $instance::modelTranslation : false;
     $properties['fields'] = $ReflectionObject->getProperties(\ReflectionProperty::IS_PUBLIC);
     return $properties;
 }