diff --git a/README.md b/README.md
index e644e6a..f55cdd4 100644
--- a/README.md
+++ b/README.md
@@ -1,136 +1,29 @@
`#php` `#oop` `#master-in-software-engineering`
-# Assembler School: OOP Basics with PHP
+# OOP Basics: Valentino Traverso
-In this project you will learn the basics of OOP using mobile devices as a reference. In the _"Project files"_ section you will find a description of the content to be displayed in each file.
+This is the solution of the OOP PHP pill created by Valentino Traverso.
-## Table of contents
+## Instance super class
-- [Table of contents](#table-of-contents)
-- [Getting Started](#getting-started)
-- [Dependencies](#dependencies)
-- [Tools](#tools)
-- [OOP Introduction](#oop-introduction)
-- [Project files](#project-files)
-
-## Getting Started
-
-### The repo
-
-First, you will need to clone the repo:
-
-```bash
-$ git clone https://github.com/assembler-school/oop-basics.git
```
-
-### Presentation material
-
-- [Slides](https://docs.google.com/presentation/d/1cZxutGPDqUGsLWLVen_ATjd7dEkeoPS_v_fy1y0C5Co/edit?usp=sharing)
-
-## Dependencies
-
-Before we can get started you will need to make sure that all the necessary dependencies are installed in your system.
-
-### PHP
-
-You can install it by following the instructions [in the official docs](https://www.php.net/downloads) (we recommend that you install the version that is named _Current_).
-
-To verify that you have installed it correctly, you can run the following command from the terminal that should output the version installed:
-
-```bash
-$ php -version
+new Brand('Dealership Name', Bool('Open[true]/Close[false]'), 'Type of vehicle', 'Style of vehicle', 'Type of energy');
```
-## Tools
-
-In the event that you prefer to use a tool that installs everything you need to configure and run a PHP server, we recommend using [XAMPP](https://www.apachefriends.org/es/download.html)
-
-### XAMPP
-
-XAMPP is a completely free and easy to install Apache distribution that contains MariaDB, PHP, and Perl. The XAMPP installation package has been designed to be incredibly easy to install and use.
-
-
-
-You have to go to the [download page](https://www.apachefriends.org/es/download.html) and it will automatically recommend installing the latest version available.
-
-
-
-Once downloaded and installed, in the case that the Windows operating system you will see the following screen, in which you will only have to start the Apache service.
-
-
-
-## OOP Introduction
-
-Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data and code: data in the form of fields (often known as attributes or properties), and code, in the form of procedures (often known as methods).
-
-## Project files
-
-### [01 - Classes](./01-classes.php)
-
-The OOP paradigm encapsulates concepts of the real world in what is called as Classes which create Objects. In this file you will learn how to create a class and instanciate it.
-
-### [02 - Properties](02-properties.php)
-
-Class member variables are called properties. In this file, you will learn how to add properties to a class and get them when the class is instantiated.
-
-### [03 - Methods](03-methods.php)
+This is the way be must create the first view of our OOP mode.
-Properties define the characteristics of an object and the methods (functions in a class are called methods) which define the behavior of the Class. In this file you will learn how to create methods inside a class.
+Then if you want to use the inherit class to determine a brand and a model of your vehicle, you must do the following:
-### [04 - Getters](04-getters.php)
-
-The get method returns the attribute value, usually there is a get method for each attribute of the class. In this file you will learn how to create **getter** methods.
-
-### [05 - Setters](05-setters.php)
-
-The set method sets the attribute value, usually there is a get method for each attribute of the class. In this file you will learn how to create **setter** methods.
-
-### [06 - Constructors](06-constructors.php)
-
-A constructor allows you to initialize an object's properties upon creation of the object. In this file you will learn how to create the constructor method.
-
-### [07 - Inheritance problem](07-inheritance-problem.php)
-
-There are several disadvantages of not applying inheritance in our code. In this file you will lean what's the problem if you don't apply any inheritance in your code.
-
-### [08 - Inheritance soluction](08-inheritance-solution.php)
-
-The child class will inherit all the public and protected properties and methods from the parent class. In addition, it can have its own properties and methods. In this file you will learn how to apply the inheritance in your code.
-
-### [09 - Public, private & protected](09-public-private-protected.php)
-
-Properties and methods can have access modifiers which control where they can be accessed. In this file you will learn le three access modifiers.
-
-### [10 - Static](10-static.php)
-
-Static properties and methods can be called directly - without creating an instance of the class first. In this file you will learn how to use static properties and methods.
-
-### [11 - Const](11-const.php)
-
-Constants cannot be changed once it is declared. Class constants can be useful if you need to define some constant data within a class. In this file you will learn how to create constants within a class.
-
-### [12 - Abstract classes](12-abstract-classes.php)
-
-Abstract classes and methods are when the parent class has a named method, but need its child class(es) to fill out the tasks. In this file you will learn how to create and use abstract classes.
-
-### [13 - Interfaces](13-interfaces.php)
-
-Interfaces allow you to specify what methods a class should implement.
-Interfaces make it easy to use a variety of different classes in the same way. When one or more classes use the same interface, it is referred to as "polymorphism". In this file you will learn how to create and extend interfaces.
-
-### [14 - Overriding](14-overriding.php)
-
-In function overriding, both parent and child classes should have same function name with and number of arguments. In this file you will learn how to implement overriding.
-
-### [15 - Overloading](15-overloading.php)
-
-Function overloading contains same function name and that function preforms different task according to number of arguments. In this file you will learn how to implement overloading.
-
-### [16 - Namespaces](16-namespaces.php)
+1- Set the brand and model:
+```
+->setBrand('Brand', 'Model');
+```
-Namespaces are qualifiers that solve two different problems:
+2- Set the price:
+```
+->setPrice(Int(price));
+```
-1. They allow for better organization by grouping classes that work together to perform a task
-2. They allow the same name to be used for more than one class
+## Author
-In this file you will learn how to create and use namespaces.
+* **Valentino Traverso**(https://github.com/valentraverso)
\ No newline at end of file
diff --git a/abstract-class.php b/abstract-class.php
new file mode 100644
index 0000000..da42773
--- /dev/null
+++ b/abstract-class.php
@@ -0,0 +1,40 @@
+intPrice = $price;
+ $this->intQuantity = $quantity;
+ }
+
+ public function setTotalBuy(){
+ $this->totalPrice = $intPrice * $intQuantity;
+ }
+
+ public function getTotalBuy(){
+ return $totalPrice;
+ }
+ }
+
+ abstract class Dealership{
+ private String $dealershipName;
+ private Bool $isOpen;
+
+ public function __construct(String $name, Bool $open){
+ $this->dealershipName = $name;
+ $this->isOpen = $open;
+ }
+
+ public function getDealership(){
+ return $this->dealershipName;
+ }
+
+ public function getOpen(){
+ return $this->isOpen;
+ }
+ }
+?>
\ No newline at end of file
diff --git a/base-class.php b/base-class.php
new file mode 100644
index 0000000..be35021
--- /dev/null
+++ b/base-class.php
@@ -0,0 +1,43 @@
+strType = $type;
+ $this->strStyle = $style;
+ $this->strEnergy = $energy;
+ }
+
+ public function getType(){
+ return $this->strType;
+ }
+
+ public function getStyle(){
+ return $this->strStyle;
+ }
+
+ public function getEnergy(){
+ return $this->strEnergy;
+ }
+
+ public function getVehicle(): String{
+ $vehicle = "
Type: $this->strType
+Energy: $this->strEnergy
+Style: $this->strStyle
"; + + return $vehicle; + } + + public function __destruct(){ + $msgDestruct = "This $this->strType was destructed"; + echo $msgDestruct; + } + + } +?> \ No newline at end of file diff --git a/inherit-class.php b/inherit-class.php new file mode 100644 index 0000000..c33d19c --- /dev/null +++ b/inherit-class.php @@ -0,0 +1,79 @@ +strBrand = $brand; + $this->strModel = $model; + } + + public function setPrice(Int $setPrice){ + $this->price = $setPrice; + } + + public function getBrand(){ + return $this->strBrand; + } + + public function getModel(){ + return $this->strModel; + } + + public function getVehicle(): String{ + $vehicle = " +Type: $this->strType
+Energy: $this->strEnergy
+Style: $this->strStyle
+Brand:".$this->strBrand."
+Model:".$this->strModel."
"; + + return $vehicle; + } + + public function statusDealership(){ + $hiText = "We are open!
"; + }else{ + $status = "Sorry, we are close
"; + } + return $hiText.$status; + } + + public function showPrice(){ + if(isset($this->price)){ + return 'Price:'.$this->price.'
'; + }else{ + return 'Id brand:".Brand::$idBrand."
"; + +$vehicle = new Brand('All Motors', true, 'Truck', '4x4', 'Fuel'); + +$vehicle->setBrand('Toyota', 'Land Cruiser'); + +echo $vehicle->statusDealership(); + +echo $vehicle->getVehicle(); + +echo $vehicle->setPrice(8000); + +echo $vehicle->showPrice(); +?> \ No newline at end of file diff --git a/interface.php b/interface.php new file mode 100644 index 0000000..0ba0a2f --- /dev/null +++ b/interface.php @@ -0,0 +1,11 @@ + \ No newline at end of file