public static function always_load($array = null)
{
parent::always_load($array);
\Module::init_modules();
}
public static function register_modules()
{
$modules_in_rdb = \Model_Module::find_all();
$modules_in_dir = static::get_module_paths();
$modules_diff = array_diff($modules_in_dir, $modules_in_rdb->get_module_names_array());
if (!empty($modules_diff)) {
\Logger::forge()->addInfo('Register new Modules', array(count($modules_diff)));
foreach ($modules_diff as $module_name) {
static::add_new_module($module_name);
}
}
}
$modules_in_rdb = \Model_Module::find_all();will generate a endless loop and if I analyze the code back this method:
public static function forge($data = array(), $new = true, $view = null)will break my skript. When can I use ORM models after loading the package?
{
return new static($data, $new, $view);
}
public static function find_all(array $options = array())
{
return static::find('all', $options);
}
It looks like you're new here. If you want to get involved, click one of these buttons!