De applicant service kan worden gebruikt om nieuwe inschrijvingen (op een vacature of open) te versturen naar EazyMatch.

Naast inschrijven is het ook mogelijk om CV’s op te halen uit het systeem om zo uw cv-database te realiseren. Op de CV’s kunnen bedrijven zich inschrijven, hierover meer in de company service.

Inschrijven / solliciteren

Het verschil tussen inschrijven en solliciteren is of er een job_id wordt meegestuurd. Inschrijvingen zonder job_id komen in het online aanmeldingen scherm van EazyMatch terug als ‘open inschrijving’. Wanneer iemand solliciteert op een functie (job_id) wordt deze vacature in EazyMatch gekoppeld aan de inschrijving en bij het goedkeuren automatisch een bemiddeling aangemaakt met de eerste fase als status (meestal koppeling).

Let op: Bij het inschrijven wordt er automatisch een mailtje gestuurd naar respectievelijk het algemene bedrijfs emailadres in eazymatch (bij open inschrijving) of naar de manager van de vacature in EazyMatch (bij sollicitatie).

We hebben, om het samenstellen van de uiteindelijke datastructuur die EazyMatch verwacht een ‘data’ class geschreven waarmee je makkelijker de complete inschrijving kan afhandelen:

applicant-data-structure.php

<?php
/**
* Structure of an applicant to be processed by EMOL3
* to make life easyer processing data from subscription forms
* 
* contains:
*     - Applicant    
*         - Person
*             - Addresses
*             - Emailaddresses
*             - Phonenumbers
*             - Identifications
*             - Bankaccounts
*     - Profile
*         - Competences
*         - Schooling
*         - Experience
*         - Onlineprofile
*         - Skill
*         - Condition
*     - Documents
*         - CV
*         - Picture
* 
* @author EazyMatch
*/

class emol_ApplicantMutation {
    
    public $Applicant;
    
    //person arrays
    public $Addresses = array();
    public $Emailaddresses = array();
    public $Phonenumbers = array();
    public $Identifications = array();
    public $Bankaccounts = array();
    
    
    //profile arrays
    public $Conditions = array();
    public $Skills = array();
    public $Onlineprofiles = array();
    public $Experiences = array();
    public $Schooling = array();
    public $Competences = array();
    
    //container variables
    public $Person;
    public $Profile;
    public $Documents;
    
    //the application
    public $Application;
    
    public $Total;
    
    /**
    * Applicant object
    * 
    * @param mixed $applicantId
    * @param mixed $intakedate
    * @param mixed $availablefrom
    * @param mixed $availableto
    * @param mixed $title
    * @param mixed $healthcarereference
    * @param mixed $linkedinrequesttoken
    * @param mixed $contactvia
    */
    function setApplicant( 
        $applicantId = null , 
        $intakedate = null , 
        $availablefrom  = null , 
        $availableto = null , 
        $title = null , 
        $healthcarereference = null, 
        $linkedinrequesttoken = null, 
        $contactvia = null, 
        $availablehours = null  ) {
        $this->Applicant = array(
            'id' => $applicantId,
            'intakedate' => $intakedate,
            'availablefrom' => $availablefrom,
            'availableto' => $availableto,
            'title' => $title,
            'healthcarereference' => $healthcarereference,
            'linkedinrequesttoken' => $linkedinrequesttoken,
            'contactvia' => $contactvia,
            'availablehours' => is_numeric($availablehours) ? $availablehours : null
        );
    }
    
    /**
    * Person Object
    * 
    * @param mixed $personId
    * @param mixed $firstname
    * @param mixed $lastname
    * @param mixed $middlename
    * @param mixed $birthdate
    * @param mixed $username
    * @param mixed $password
    * @param mixed $gender
    * @param mixed $managercompany_id
    */
    function setPerson( $personId = null, $firstname = null , $middlename = null , $lastname  = null , $birthdate = null, $username = null, $password = null, $gender = null, $managercompany_id = null){
        
        //else everyone will be 41 years old at the moment
        if($birthdate != null){
            $birthdate = date('Ymd',strtotime($birthdate));
        }
        
        $this->Person = array(
            'id' => $personId,
            'managercompany_id' => $managercompany_id,
            'firstname' => $firstname,
            'lastname' => $lastname,
            'middlename' => $middlename,
            'birthdate' => $birthdate,
            'username' => $username,
            'password' => str_replace('**********','',$password),
            'gender' => $gender,
        );
        
    }
    
    /**
    * Add addresses
    * 
    * @param mixed $province_id
    * @param mixed $country_id
    * @param mixed $region_id
    * @param mixed $street
    * @param mixed $housenumber
    * @param mixed $extension
    * @param mixed $zipcode
    * @param mixed $city
    */
    function addAddress( $id=null, $province_id = null , $country_id  = null , $region_id = null , $street = null , $housenumber = null , $extension = null , $zipcode = null , $city = null, $addresstype_id = null){
        
        if($id === null){
            $id = rand(-1,-99999);
        }
        $this->Addresses[] = array(
                'id' => $id,//to relate to preferred address
                'addresstype_id' => $addresstype_id,
                'province_id' => $province_id,
                'country_id' => $country_id,
                'region_id' => $region_id,
                'street' => $street,
                'housenumber' => $housenumber,
                'extension' => $extension,
                'zipcode' => $zipcode,
                'city' => $city,
        );
    }
    
    /**
    * Adds an email address to the person
    * 
    * @param mixed $id
    * @param mixed $emailtype_id
    * @param mixed $email
    */
    function addEmailaddresses($id=null ,$emailtype_id = null, $email=null){
        if($id === null){
            $id = rand(-1,-99999);
        }
        $this->Emailaddresses[] = array(
            'id' => $id,//to relate to preferred address
            'emailtype_id' => $emailtype_id,
            'email' => $email
        );
    }
    
    /**
    * Adds an phonenumber to the person
    * 
    * @param mixed $id
    * @param mixed $phonenumbertype_id
    * @param mixed $phonenumber
    */
    function addPhonenumber($id=null ,$phonenumbertype_id = null, $phonenumber=null){
        if($id === null){
            $id = rand(-1,-99999);
        }
        $this->Phonenumbers[] = array(
            'id' => $id, //to relate to preferred address
            'phonenumbertype_id' => $phonenumbertype_id,
            'phonenumber' => $phonenumber
        );
    }
    
    /**
    * Adds an id
    * 
    * @param mixed $identificationtype_id
    * @param mixed $experationdate
    * @param mixed $number
    */
    function addIdentification($identificationtype_id =null, $experationdate = null, $number = null){
        $this->Identifications[] = array(
            'identificationtype_id' => $identificationtype_id,
            'experationdate' => $experationdate,
            'number' => $number,
        );
    }
    
    
    /**
    * Adds a bankaccount
    * 
    * @param mixed $bankaccounttype_id
    * @param mixed $accountnr
    * @param mixed $city
    */
    function addBankaccount($bankaccounttype_id =null, $accountnr = null, $city = null){
        $this->Bankaccounts[] = array(
            'bankaccounttype_id' => $bankaccounttype_id,
            'accountnr' => $accountnr,
            'city' => $city,
        );
    }
    
    /**
    * Set the CV document
    * 
    * @param mixed $name
    * @param mixed $type
    * @param mixed $content
    */
    function setCV($name = null, $type = null, $content = null){
        $this->Documents['CV'] = array(
            'name' => $name,
            'type' => $type,
            'content' => $content //base64 encoded
        );
    }
    
    /**
    * Set the Picture document
    * 
    * @param mixed $name
    * @param mixed $type
    * @param mixed $content
    */
    function setPicture($name = null, $type = null, $content = null){
        $this->Documents['Picture'] = array(
            'name' => $name,
            'type' => $type,
            'content' => $content //base64 encoded
        );
    }
    
    /**
    * sets the conditions of the applicant
    * 
    * @param mixed $description
    * @param mixed $mandatory
    */
    function addCondition($description='',$mandatory=0){
        $this->Conditions[] = array(
            'mandatory' => $mandatory,
            'description' => $description
        );
    }
    
    
    /**
    * sets the skills of the applicant
    * 
    * @param mixed $description
    * @param mixed $title
    */
    function addSkill($description='',$title=''){
        $this->Skills[] = array(
            'title' => $title,
            'description' => $description
        );
    }
    
    /**
    * adds online / urls for an applicant
    * 
    * @param mixed $onlineprofiletype_id
    * @param mixed $url
    */
    function addOnlineprofile($onlineprofiletype_id=null,$url=''){
        $this->Onlineprofiles[] = array(
            'onlineprofiletype_id' => $onlineprofiletype_id,
            'url' => $url
        );
    }
    
    
    /**
    * Adds working experience or courses of an applicant
    * 
    * @param mixed $experiencetype_id
    * @param mixed $visible
    * @param mixed $function
    * @param mixed $startdate
    * @param mixed $enddate
    * @param mixed $description
    * @param mixed $company
    */
    function addExperience($experiencetype_id = null, $visible = null, $function = null, $startdate = null, $enddate = null, $description = '', $company = '' ){
        $this->Experiences[] = array(
            'experiencetype_id' => $experiencetype_id,
            'visible' => $visible,
            'function' => $function,
            'startdate' => $startdate,
            'enddate' => $enddate,
            'description' => $description,
            'company' => $company,
        );
    }
    
    /**
    * adds a school / education of the applicant
    * 
    * @param mixed $schoolingtype_id
    * @param mixed $institute
    * @param mixed $degree
    * @param mixed $startdate
    * @param mixed $enddate
    */
    function addSchooling($schoolingtype_id = null, $institute = null, $degree = null, $startdate = null, $enddate = null){
        $this->Schooling[] = array(
            'schoolingtype_id' => $schoolingtype_id,
            'degree' => $degree,
            'startdate' => $startdate,
            'enddate' => $enddate,
        );
    }
    
    /**
    * adds a competence to the applicant
    * 
    * @param mixed $competence_id
    */
    function addCompetence($competence_id = null){
        if(isset($competence_id ) && is_numeric($competence_id) && $competence_id > 0){
            $this->Competences[] = array(
                'id' => $competence_id
            );
        }
    }
    
    /**
    * sets a match or something (connection between job and applicant)
    * 
    * @param mixed $jobId
    * @param mixed $motivation
    */
    function setApplication($jobId=null,$motivation='',$url=''){
        $this->Application = array(
            'job_id' => $jobId,
            'motivation' => $motivation,
            'url' => $url
        );
    }
    
    /**
    * creates the complete structure that can be posted to EMOL3
    * 
    */
    function createSubscription(){
        
        /**
        * Addresses
        */
        $pa = array();
        if(isset($this->Addresses[0]) && is_array($this->Addresses[0])){
            $pa = $this->Addresses[0];
        }
        $this->Person['Addresses'] = $this->Addresses;
        $this->Person['Preferedaddress'] = $pa; //take the first address as the preferred one
        
        /**
        * Email
        */
        
        $pa = array();
        if(isset($this->Emailaddresses[0]) && is_array($this->Emailaddresses[0])){
            $pa = $this->Emailaddresses[0];
        }
        $this->Person['Emailaddresses'] = $this->Emailaddresses;
        $this->Person['Preferedemailaddress'] = $pa; //take the first address as the preferred one
        
        /**
        * Phonenumbers
        */
        $pa = array();
        if(isset($this->Phonenumbers[0]) && is_array($this->Phonenumbers[0])){
            $pa = $this->Phonenumbers[0];
        }
        $this->Person['Phonenumbers'] = $this->Phonenumbers;
        $this->Person['Preferedphonenumber'] = $pa; //pref phoine
        
        
        //rest
        $this->Person['Identifications'] = $this->Identifications;
        $this->Person['Bankaccounts'] = $this->Bankaccounts;
        
        //set the person
        $this->Applicant['Person'] = $this->Person;
        
        //compile the profile
        $this->Profile['Condition'] = $this->Conditions;
        $this->Profile['Skill'] = $this->Skills;
        $this->Profile['Onlineprofile'] = $this->Onlineprofiles;
        $this->Profile['Experience'] = $this->Experiences;
        $this->Profile['Schooling'] = $this->Schooling;
        $this->Profile['Competence'] = $this->Competences;
        
        $return = array(
            'Applicant' => $this->Applicant,
            'Profile' => $this->Profile,
            'Documents' => $this->Documents,
            'Application' => $this->Application,
        );
        return $return;
    }
    
    
    /**
    * creates the complete structure that can be posted to EMOL3
    * 
    */
    function createApplicant(){
        
        //compile addresses
        $this->Person['Addresses'] = $this->Addresses;
        $this->Person['Preferedaddress'] = $this->Addresses[0]; //take the first address as the preferred one
        $this->Person['Emailaddresses'] = $this->Emailaddresses;
        $this->Person['Phonenumbers'] = $this->Phonenumbers;
        $this->Person['Identifications'] = $this->Identifications;
        $this->Person['Bankaccounts'] = $this->Bankaccounts;
        
        //set the person
        $this->Applicant['Person'] = $this->Person;
        
        //compile the profile
        $this->Applicant['Condition'] = $this->Conditions;
        $this->Applicant['Skill'] = $this->Skills;
        $this->Applicant['Onlineprofile'] = $this->Onlineprofiles;
        $this->Applicant['Experience'] = $this->Experiences;
        $this->Applicant['Schooling'] = $this->Schooling;
        $this->Applicant['Competence'] = $this->Competences;
        
        //return the applicant + person
        return $this->Applicant;
    }
    
    
}


In onderstaand voorbeeld wordt de class om deze datastructuur op te bouwen niet gebruikt. Om een voorbeeld te bekijken van hoe deze gebruikt kan worden, check dan de company service.
subscription.php

<?php
/**
* example to connect with eazymatch and do a subscription (with job_id)
*/

$rootDir = dirname(dirname(__FILE__));

//include the autoloader for eazymatch classes
include_once( $rootDir . '/bootstrap.autoload.php' );

//create a new connection using our private configuration
$apiConnect = new emolclient_manager_base( include( $rootDir . '/config.php' )  );


/**
* create a structure for the subscription, this is just an example. 
* 
* The only mandatory fields are: 
* [Applicant]intakedate
* [Applicant][Person]firstname
* [Applicant][Person]lastname
* [Application]
* array => [Applicant][Person][Emailaddresses]
* 
*/
$newSubscription = array(
	'Applicant' => array(
		'intakedate' => '2012-11-01', //always use this dateformat
		'available' => 1, //1 = yes, 0 = no
		'availablehours' => 40, //numeric
		'availablefrom' => '2012-11-01',
		'availableto' => '2019-11-01',
		'title' => 'Test manager',
		'contactvia' => 'Google',
		'Person' => array(
			'firstname' => 'John',
			'middlename' => '',
			'lastname' => 'Doe',
			'birthdate' => '1978-04-24',
			'gender' => 'm', //m=male, f=female
			'Emailaddresses' => array( //at least 1
				array(
					'id' => -1, //minus 1 will tell the core to set this address as the default address
					'email' => 'johndoe@eazymatch.nl'
				),
				array(
					'id' => null,
					'email' => 'johndoe@eazymatch-at-home.nl'
				)
			),
			'Addresses' => array(
				array(
					'id' => -1, //minus 1 will tell the core to set this address as the default address
					'street' => 'Mainstreet',
					'housenumber' => '1',
					'extension' => 'bis',
					'zipcode' => '1017PR',
					'city' => 'Amsterdam',
				)
				
			),
			'Phonenumbers' => array(
				array(
					'id' => -1, //minus 1 will tell the core to set this address as the default address
					'phonenumber' => '020-123456789',
				),
				array(
					'id' => null,
					'phonenumber' => '06-1234567890',
				)
			),
			'Identifications' => array(
				array(
					'id' => null,
					'experationdate' => '2028-10-01',
					'number' => 'NL28939B0,2373',
				),
			),
			'preferedemailaddress_id' => -1,
			'preferedaddress_id' => -1,
			'preferedphonenumber_id' => -1,
			
		)
	),
	'Profile' => array(
		'Onlineprofile' => array(
			array(
				'url' => 'www.mywebsite.com'
			)
		),
		'Experience' => array(
			array(
				'function' => 'Accountmanager test 1',
				'startdate' => '1998-02-01',
				'enddate' => '2004-02-01',
				'description' => 'My function here was to be an accountmanager',
				'company' => 'Employer way back',
			),
			array(
				'function' => 'Accountmanager test 2',
				'startdate' => '2004-02-01',
				'enddate' => '2010-12-01',
				'description' => 'My second function, now im searching for something new',
				'company' => 'Other company',
			)
		),
		'Schooling' => array(
			array(
				'degree' => 'Havo',
				'startdate' => '1988-02-01',
				'enddate' => '1992-12-01',	
			),
			array(
				'degree' => 'HBO',
				'startdate' => '1992-02-01',
				'enddate' => '1994-02-01',	
			)
		)
	),
	'Application' => array( //is mandatory
		'job_id' => null, //open subscription, set the job_id here to create a connection to a job
        'motivation' => 'My motivation, i\'d like to work here.',
        'url' => 'http://www.recruitmentsite.com/subscribe' // this is just a text reference from where the application is done
	),
	'Documents' => array(
		'CV' => array(
			'name' => 'my-cv-document.docx', //can be doc, docx, pdf
	        'type' => 'docx',
	        'content' => '' //base64 encoded
		),		
		'Picture' => array(
			'name' => 'mypicture.png',
	        'type' => 'png',
	        'content' => '' //base64 encoded
		),		
	)
);

//  TheConnection -> TheController -> TheMethod ( Parameters );
$result = $apiConnect->applicant->subscription( $newSubscription );

echo '<pre>';
var_dump($result); //returns true on success
echo '</pre>';

<< terug