PHP Classes

File: examples/dddexample/Model/Cargo.php

Recommend this page to a friend!
  Classes of Haseeb Ahmad Basil   PHP Skeleton Framework   examples/dddexample/Model/Cargo.php   Download  
File: examples/dddexample/Model/Cargo.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Skeleton Framework
Extensive Web application development framework
Author: By
Last change:
Date: 8 years ago
Size: 712 bytes
 

Contents

Class file image Download
<?php

class Cargo {

    private
$trackingId;
    private
$origin;
    private
$destination;

    function
__construct ($trackingId, $origin, $destination) {
        if (
is_null ($trackingId)) throw new Exception ('Tracking ID cannot be null');
        if (
is_null ($origin)) throw new Exception ('Origin cannot be null');
        if (
is_null ($destination)) throw new Exception ('Destination cannot be null');
       
$this->trackingId = $trackingId;
       
$this->origin = $origin;
       
$this->destination = $destination;
    }

    function
trackingId() {
        return
$this->trackingId;
    }

    function
origin() {
        return
$this->origin;
    }

    function
destination() {
        return
$this->destination;
    }

}