I really want to pick this up... are there any good links to advanced OOP? or something you might actually use realistically. Everything I find is basic create an animal.. make it speak or similar.
For example, I would like to create pdf flyers from the property object. But should I create a separate object for this or create a method in the property class?
I guess what I'm looking for is steps you should take in planning out classes, creating a skeleton or layout, etc.?
Any tips / help / links are greatly appreciated.
<?php
class Property{
private $lotSize = 0;
private $zoning = array();
private $buildings = array();
private $parkingLot;
//Create New Property
function __construct($size){
$this->lotSize = $size;
}
//Construct a Building on the Property
function build(Building $name){
$this->buildings[] = $name;
}
//Construct Parking Lot on Site
function pave($area, $spaces, $handicap=0){
$this->parkingLot = new ParkingLot($area, $spaces, $handicap);
}
//Assign Property Owner
//If lot size is over 21,825 Square Feet (.5 Acres), Convert to Acres
//Add Zoning
function addZoning($zone){
$this->zoning[] = $zone;
}
//Remove Zoning
function removeZoning($zone){
unset($this->zoning[$zone]);
}
}
class CommercialProperty extends Property
{
}
class ParkingLot
{
private $parking = 0;
private $handicapParking = 0;
//Create Parking Lot
function __construct($area, $spots, $hc=0)
{
$this->parking = $spots;
$this->handicapParking = $hc;
}
//Add Handicap Parking Spaces
}
class Building
{
public $name;
private $elevators = 0;
private $floors = 1;
private $yearBuilt;
//Construct Building
function __construct($name, $year)
{
$this->name = $name;
$this->yearBuilt = $year;
}
//Set Address
//Assign Property Manager
//Assign Broker
}
class CommercialBuilding extends Building
{
//Construct Commercial Building
function __construct(){
}
}
class OfficeBuilding extends CommercialBuilding
{
//Construct Office Building
function __construct(){
}
//Add Office Suites
//Combine Office Suites
//Remove Office Suites
}
class RetailBuilding extends CommercialBuilding
{
//Construct Retail Building
function __construct(){
}
}
class Space
{
//Create Space
function __construct(){
}
//Lease Space
//Delete Space
}
class OfficeSpace extends Space
{
//Create Office Space
//Lease Office Space
//Delete Office Space
}
class RetailSpace extends Space
{
//Create Retail Space
function __construct(){
}
//Lease Retail Space
//Delete Retail Space
}
class Person{
//Create Person
function __construct(){
}
}
class PropertyOwner extends Person
{
}
class PropertyManager extends Person
{
}
class Broker extends Person
{
}
class Lease
{
//Create Lease
function __construct(){
}
//Assign Lease
//Un-Assign Lease
//Renew Lease
//Extend Lease
//Break Lease
//Delete Lease
}
?>