<?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 her 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)
$prospect = new DavidLaker();
$employ = $prospect->shouldYouEmploy();
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;
collapse
public function __construct() {
$this->_setSkills();
$this->_setEducation();
}
collapse
private function _setPersonalDetails() {
$this->personalDetails = array(
'first_name' => 'David',
'last_name' => 'Laker',
'email' => 'dave@davidlaker.co.uk',
'mobile' => '(415) 858-4173',
'linkedin' => 'http://www.linkein.com/in/davelaker',
'twitter' => 'http://www.twitter.com/davelaker',
'web' => 'davidlaker.co.uk',
'gender' => 'male',
'dob' => '1982-08-15 22:41:39', # August 1982
);
}
/**
 * Employment history of prospect
 *
 * @return bool true
 */
collapse
private function _setEmploymentHistory() {
$this->employment = array(
'VP North America' => array(
'company' => 'idio Ltd',
'location' => array(
'address' => 'San Francisco',
'lat' => '37.77493',
'long' => '-122.41942',
),
'url' => 'idioplatform.com',
'from' => '2011-08-04 07:59:42', # August 2011
'until' => null, # Currently Employed
'role' =>
'Responsible for managing North America operations, developing relationships with key
advertising agencies idios\' unique content marketing platform to consumer brands and
media agencies.',
),
'Technical Manager' => array(
'company' => 'idio Ltd',
'location' => array(
'address' => 'Floor 33, Euston Tower 286 Euston Road London, NW1 3DP (United Kingdom)',
'lat' => '51.52524',
'long' => '-0.13929',
),
'url' => 'idioplatform.com',
'from' => '2010-05-24 08:52:26', # May 2010
'until' => '2011-08-01 17:32:53', # August 2011
'role' =>
'Managed a small team of web developers contributing to the implementation of the idio
content marketing platform. Developed the platform utilizing various API's and semantic
engines to analyze content and personalize multi-channel content marketing. Identified
bottle necks in the db schema and content analysis process, and implemented MongoDB &
Sphinx search to improve performance. Held weekly stand up meetings to ensure progress with
milestones, and timely completion of projects. Performed code reviews, and introduced the
concept of \'Pair Programming\' which helped new employees get up to speed quicker and,
reduced the number or errors and bugs.',
),
'Lead Web Developer' => array(
'company' => 'Sitemakers Ltd',
'location' => array(
'address' => 'Unit 15 Bowdens Business Centre, Hambridge, Somerset, TA10 0BP (United Kingdom)',
'lat' => '51.00062',
'long' => '-2.85964',
),
'url' => 'sitemakers.co.uk',
'from' => '2006-05-06 08:57:25', # May 2006
'until' => '2010-05-21 17:38:19', # May 2010
'role' =>
'Joint project lead on our successful SaaS e-commerce platform called LiquidShop
(liquidshop.com). Developed and implemented key features including trigger email
system (abandoned cart, write a review, vouchers after order) and database integration
(tool to map XML or CSV feed to appropriate database fields). Held bi-weekly meetings
between directors, designers, sales and support to review bug reports and feature
requests. Web server maintenance using Linux (CentOS) WHM and cPanel. Created bash
scripts to help everyday procedures run quicker and more effectively. Organized
monthly pool tournament',
),
);
$experienced = true;
return $experienced;
}
/**
 * Education History
 *
 * @return bool true
 */
collapse
private function _setEducation() {
$this->education = array(
'university' => array(
'school' => 'University of Wales Swansea',
'course' => 'Mobile Communications and Internet Technology',
'location' => array(
'address' => 'Singleton Park, Swansea, SA2 8PP (United Kingdom)',
'lat' => '51.60989',
'long' => '-3.97313',
),
'from' => 'September 2001',
'until' => 'June 2004',
),
'college' => array(
'school' => 'Strode College',
'course' => 'Advanced GNVQ in IT',
'location' => array(
'address' => 'Church Road, Street, Somerset, BA16 0AB (United Kingdom)',
'lat' => '51.13100',
'long' => '-2.73390',
),
'from' => 'September 1997',
'until' => 'June 2000',
),
);
return true;
}
/**
 * Skills available to employer
 *
 * @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',
'script.aculo.us' => 'great',
'YUI' => 'good',
),
'CSS' => 'good',
'VersionControl' => array(
'Git' => 'good',
'Subverison' => 'good',
'CVS' => 'none',
'Mercurial' => 'none',
),
'NoSQL' => array(
'MongoDB' => 'beginner',
'CouchDB' => 'none',
'Cassandra' => 'none',
),
'Java' => '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;
}
}
}