Skip to content

Instantly share code, notes, and snippets.

@MasterHans
Created October 21, 2021 17:40
Show Gist options
  • Save MasterHans/4c3efef42eb36165b87e19e91fe9c863 to your computer and use it in GitHub Desktop.
Save MasterHans/4c3efef42eb36165b87e19e91fe9c863 to your computer and use it in GitHub Desktop.
PHP create class without constructor
public function getSettingsFieldsMap($providerName, $moduleName)
{
Yii::import('application.modules.' . $moduleName . '.models.' . $providerName);
$reflection = new ReflectionClass($providerName);
$instance = $reflection->newInstanceWithoutConstructor();
return $instance->getAttributeConfig();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment