public function __construct($referralID = 0)
 {
     parent::__construct($referralID);
     // -- Set the variables up
     // -----------------------
     $this->apiKey = 'KJAH8qw';
     $this->apiAddress = 'http://109.235.124.18:82/apipost.php';
     // -- Set the Model
     // ----------------
     \Referrals_callback_model::forge((int) $referralID);
 }
 public function createCallback($callbackOn = null, $type = null)
 {
     // -- Create a Call back for the selected Referral
     // -----------------------------------------------
     // 1) Check that a there isn't a callback already set for that date & time
     // -----------------------------------------------------------------------
     $callbackExists = \Referrals_callback_model::duplicationCheck($callbackOn);
     if ($callbackExists > 0) {
         // -- A callback was found, load it up to show the Agent
         // -----------------------------------------------------
         \Log::error("Callback already exists, don't know what to do with it!", "Crm_Referrals_Callback_Class");
     } else {
         // -- No callback found, so create it
         // ----------------------------------
         $callbackID = 0;
         list($driver, $user_id) = \Auth::get_user_id();
         $thisUser = \Model_User::find($user_id);
         // User ID, Center ID, Callback Date/Time, Type 'A' = All and 'P' = Personal
         $callbackID = \Referrals_callback_model::createCallback($user_id, $thisUser->call_center_id, $callbackOn, $type);
         return $callbackID;
     }
 }