Skip to content

Commit

Permalink
Refactoring for extensions-manager/object.php
Browse files Browse the repository at this point in the history
  • Loading branch information
alexxgermann committed Oct 5, 2016
1 parent d6a2f92 commit 754c1c8
Showing 1 changed file with 29 additions and 21 deletions.
50 changes: 29 additions & 21 deletions runway-framework/framework/includes/extensions-manager/object.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* ExtmSettingsObject
*
Expand All @@ -8,37 +9,44 @@
* @license
* @link
*/
class ExtmSettingsObject extends Runway_Object {
public $settings;
class ExtmSettingsObject extends Runway_Object {

private $settings_object;

function __construct( $settings ) {

public function __construct( $settings ) {

$this->settings = $settings;
}

public function __call($name, $arguments){
if(!isset($this->settings_object)){
include_once FRAMEWORK_DIR.'framework/core/admin-object.php';
include_once 'settings-object.php';
}

public function __call( $name, $arguments ) {

if ( ! isset( $this->settings_object ) ) {
include_once FRAMEWORK_DIR . 'framework/core/admin-object.php';
include_once __DIR__ . 'settings-object.php';
$this->settings_object = new Extm_Admin( $this->settings );
}

return call_user_func_array(
array(
$this->settings_object,
$this->settings_object,
$name
),
$arguments);
}

public function __get($name){
if(!isset($this->settings_object)){
include_once FRAMEWORK_DIR.'framework/core/admin-object.php';
include_once 'settings-object.php';
),
$arguments
);

}

public function __get( $name ) {

if ( ! isset( $this->settings_object ) ) {
include_once FRAMEWORK_DIR . 'framework/core/admin-object.php';
include_once __DIR__ . 'settings-object.php';
$this->settings_object = new Extm_Admin( $this->settings );
}

return (isset($this->settings_object->$name)) ? $this->settings_object->$name : false;

return isset( $this->settings_object->$name ) ? $this->settings_object->$name : false;

}

}
?>

0 comments on commit 754c1c8

Please sign in to comment.