Chapter 6

We were tasked to do exercises 6.1 to 6.4 from chapter 6.

6.1

function get_employer ( ) {
return $this->employer;
}

function set_employer ($new_employer) {
$this->employer = $new_employer;
}

function get_contact_person(){
return $this->contact_person;
}

function set_contact_person($person){
$this->contact_person = $person;
}

function set_contact_phone($phone_number){
$this->contact_phone = $phone_number;
}

function get_contact_phone(){
return $this->contact_phone;
}

6.2

function __construct ($f , $1 , $a , $c , $s , $z , $p1 , $p2 , $e , $t , $status , $employer , $contact , $contact_phone) {
$this->f = $f;
$this->1 = $1;
$this->a = $a;
$this->c = $c;
$this->s = $s;
$this->z = $z;
$this->p1 = $p1;
$this->p2 = $p2;
$this->e = $e;
$this->t = $t;
$this->status = $status;
$this->employer = $employer;
$this->contact = $contact;
$this->contact_phone = $contact_phone;
}

6.3

The function should automatically set the person to inactive if there are any invalid inputs and also print out associated error to the console log.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s