Created
December 15, 2013 23:44
-
-
Save azcdev/7979950 to your computer and use it in GitHub Desktop.
Clases concretas para los Productos en PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MotorDiesel extends Motor { | |
public function __construct($cilindros) { | |
$this->cilindros = $cilindros; | |
} | |
} | |
class MotorGasolina extends Motor { | |
public function __construct($cilindros) { | |
$this->cilindros = $cilindros; | |
} | |
} | |
class MotorBiodiesel extends Motor { | |
public function __construct($cilindros) { | |
$this->cilindros = $cilindros; | |
} | |
} | |
class CarroDiesel extends Carro { | |
public function __construct($cilindros) { | |
$this->motor = new MotorDiesel($cilindros); | |
} | |
} | |
class CarroGasolina extends Carro { | |
public function __construct($cilindros) { | |
$this->motor = new MotorGasolina($cilindros); | |
} | |
} | |
class CarroBiodiesel extends Carro { | |
public function __construct($cilindros) { | |
$this->motor = new MotorBiodiesel($cilindros); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment