<?php
define('MAKE_GREAT_DECISIONS', true); # Does the employer make great decisions?
# Two things to note:
# 1) Obviously the class instantiation should be after the class declaration, but placed here for clarity
# 2) Normally OOP would have a 'David Laker' object be an instantiation of a Person Class
# but as you will see this is just a bit of fun. (A colleague suggested I make this distinction)
try {
if($employ === true) {
$goodTimes = true;
$greatWork = true;
NewEmployee::sendWelcomeMessage($prospect->getEmail());
}
else {
throw new Exception('WTF!');
}
} catch (Exception $e) {
echo '<strong>Unexpected Error:</strong> Please inform '.$prospect->getName().' why';
echo ($prospect->getGender() === 'male') ? ' he ' : ' she ';
echo ' did\'t make the cut';
}
/**
* This class extends 'GreatEmployee' which contains the public functions
* getName(), getGender() and getEmail() and checkRequiredSkills()
* @return bool true
*/
class DavidLaker extends GreatEmployee {
private $personalDetails;
private $employment;
private $education;
private $skills;
public function __construct() {
$this->_setPersonalDetails();
$this->_setEmploymentHistory();
$this->_setSkills();
$this->_setEducation();
}
private function _setPersonalDetails() {
$this->personalDetails = array(
'first_name' => 'David',
'last_name' => 'Laker',
'email' => 'dave@davidlaker.co.uk',
'linkedin' => 'http://www.linkedin.com/in/davelaker',
'web' => 'davidlaker.co.uk',
'gender' => 'male',
'dob' => '1982-08-15 22:41:39', # August 1982
);
}
/** @return bool true */
collapse
private function _setEmploymentHistory() {
$this->employment = array(
'VP North America' => array(
'company' => 'idio Ltd',
'location' => 'San Francisco',
'url' => 'idioplatform.com',
'from' => '2011-08-04', # August 2011
'until' => null, # (role at the time this CV was written)
'role' => 'Responsible for managing North America operations, developing relationships with key advertising agencies and taking idio's unique content marketing platform to consumer brands and media agencies.',
),
'Technical Manager' => array(
'company' => 'idio Ltd',
'location' => 'Floor 33, Euston Tower, London NW1 3DP',
'url' => 'idioplatform.com',
'from' => '2010-05-24', # May 2010
'until' => '2011-08-01', # August 2011
'role' => 'Managed a small team of web developers contributing to the implementation of the idio content marketing platform. Identified bottlenecks in the db schema and content analysis process, and implemented MongoDB & Sphinx search to improve performance. Introduced pair programming and code reviews.',
),
'Lead Web Developer' => array(
'company' => 'Sitemakers Ltd',
'location' => 'Hambridge, Somerset',
'url' => 'sitemakers.co.uk',
'from' => '2006-05-06', # May 2006
'until' => '2010-05-21', # May 2010
'role' => 'Joint project lead on LiquidShop, a SaaS e-commerce platform. Developed trigger email systems, database integration tools, and web server maintenance on Linux (CentOS). Also organised the monthly pool tournament.',
),
);
$experienced = true;
return $experienced;
}
/** @return bool true */
collapse
private function _setEducation() {
$this->education = array(
'university' => array(
'school' => 'University of Wales Swansea',
'course' => 'Mobile Communications and Internet Technology',
'from' => 'September 2001',
'until' => 'June 2004',
),
'college' => array(
'school' => 'Strode College',
'course' => 'Advanced GNVQ in IT',
'from' => 'September 1997',
'until' => 'June 2000',
),
);
return true;
}
/** @return bool true */
collapse
private function _setSkills() {
$this->skills = array(
'PHP' => 'excellent',
'PHP Frameworks' => array( 'CakePHP' => 'great', 'Yii' => 'good', 'Zend' => 'beginner' ),
'MySQL' => 'excellent',
'JavaScript' => array( 'Core' => 'good', 'jQuery' => 'excellent', 'Prototype' => 'great' ),
'CSS' => 'good',
'VersionControl' => array( 'Git' => 'good', 'Subversion' => 'good' ),
'NoSQL' => array( 'MongoDB' => 'beginner' ),
'teamPlayer' => 'excellent',
'willingnessToExpandSkills' => 'excellent',
'pingPong' => 'great',
'bowling' => 'good',
'iceSkating' => 'poor',
);
return true;
}
/**
* Should you employ this prospect?
* @return bool
*/
collapse
public function shouldYouEmploy() {
# Does the prospect meet requirements?
$hasRequiredSkills = parent::checkRequiredSkills($this->skills);
if(($hasRequiredSkills === true) && (MAKE_GREAT_DECISIONS === true)) {
return true;
}
else {
# You should at least meet him, you might change your mind!
return false;
}
}
}