-
Notifications
You must be signed in to change notification settings - Fork 0
Object Oriented Programming
Marie-Louise edited this page Oct 11, 2018
·
12 revisions
languages like java are purely OOP
PHP is a scripting language that has a bit of HTML, OOP and logic
Basic OOP
Drupal started at a time when object oriented programming ...
- Polymorphism
- Abstraction
- Encapsulation
- Inheritance
Glossary
Class - An encapsulation of some functionality
Subclass - An extension to a base class that inherits the base classy functionality but adds more
Property - A property of a class that represents a value
Function - Some logic that either modifies a property or returns some value
Exercise
<?php
//base class
class Shape {
declare the base class. Other classes can be declared within this with different values
const SHAPE_TYPE = 1;
protected means that the value cannot be changed
private means that the value can be changed but it can't be accessed directly.
