Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ini_set('display_errors', 1);
- ini_set('display_startup_errors', 1);
- error_reporting(E_ALL);
- class Main
- {
- // Parameters
- protected $rule_type;
- protected $layer_number;
- protected $limiter;
- protected $multiplier;
- protected $main_client_id;
- protected $daterange;
- protected $level;
- protected $cpc_type;
- protected $ruleId;
- public function ruleType($ruleType)
- {
- $this->rule_type = $ruleType;
- return $this;
- }
- public function layerNumber($layerNumber)
- {
- $this->layer_number = $layerNumber;
- return $this;
- }
- public function limiter($limiter)
- {
- $this->limiter = $limiter;
- return $this;
- }
- public function multiplier($multiplier)
- {
- $this->multiplier = $multiplier;
- return $this;
- }
- public function mainClientId($mainClientId)
- {
- $this->main_client_id = $mainClientId;
- return $this;
- }
- public function dateRange($dateRange)
- {
- $this->daterange = $dateRange;
- return $this;
- }
- public function level($level)
- {
- $this->level = $level;
- return $this;
- }
- public function cpcType($cpcType)
- {
- $this->cpc_type = $cpcType;
- return $this;
- }
- }
- class Cpc extends Main
- {
- public function __construct()
- {
- echo 'this cpc construct <br>';
- }
- public function generateCpc()
- {
- echo 'this cpc generated <br>';
- echo $this->rule_type;
- echo $this->layer_number;
- echo $this->limiter;
- echo $this->multiplier;
- echo $this->main_client_id;
- echo $this->daterange;
- echo $this->level;
- echo $this->cpc_type;
- echo $this->ruleId;
- echo '<br>';
- }
- }
- class Basetable extends Cpc
- {
- public function __construct()
- {
- echo 'this basetable construct <br>';
- }
- public function generateBasetable()
- {
- echo 'this basetable generated <br>';
- echo $this->rule_type;
- echo $this->layer_number;
- echo $this->limiter;
- echo $this->multiplier;
- echo $this->main_client_id;
- echo $this->daterange;
- echo $this->level;
- echo $this->cpc_type;
- echo $this->ruleId;
- echo '<br>';
- }
- }
- class Layer extends Basetable
- {
- public function __construct()
- {
- echo 'this layer construct <br>';
- }
- public function generateLayer()
- {
- echo 'this layer generated <br>';
- echo $this->rule_type;
- echo $this->layer_number;
- echo $this->limiter;
- echo $this->multiplier;
- echo $this->main_client_id;
- echo $this->daterange;
- echo $this->level;
- echo $this->cpc_type;
- echo $this->ruleId;
- echo '<br>';
- }
- }
- class Master extends Layer
- {
- public function __construct()
- {
- echo 'this Master construct <br>';
- }
- public function generate()
- {
- $this->generateCpc();
- $this->generateBasetable();
- $this->generateLayer();
- echo 'this master generated <br>';
- echo $this->rule_type;
- echo $this->layer_number;
- echo $this->limiter;
- echo $this->multiplier;
- echo $this->main_client_id;
- echo $this->daterange;
- echo $this->level;
- echo $this->cpc_type;
- echo $this->ruleId;
- echo '<br>';
- }
- }
- $o = new Master();
- $o = $o->mainClientId('all')
- ->level('layer')
- ->ruleType('placement')
- ->layerNumber(1)
- ->limiter(10)
- ->multiplier(1.5)
- ->cpcType('last_day')
- ->dateRange(20170701)
- ->generate();
- ?>
- <?php
- class Main
- {
- }
- class Cpc extends Main
- {
- }
- class Basetable extends Cpc
- {
- }
- class Layer extends Basetable
- {
- }
- class Master extends Layer
- {
- }
- ?>
- <?php
- class Main
- {
- }
- class Cpc extends Main
- {
- public function generateSomething(){
- }
- }
- class Basetable extends Main
- {
- public function generateSomething(){
- }
- }
- class Layer extends Main
- {
- public function generateSomething(){
- }
- }
- class Master extends Main
- {
- $cpc = new Cpc();
- $cpc = $cpc->generateSomething();
- $basetable = new Basetable();
- $basetable = $basetable->generateSomething();
- $layer = new Layer();
- $layer = $layer->generateSomething();
- }
- ?>
Add Comment
Please, Sign In to add comment