function sync_from_API($mode = '')
 {
     global $beanFiles;
     require_once $beanFiles['TILKEE_PROJECTS'];
     $associated_project = new TILKEE_PROJECTS();
     $projects_array = $this->get_linked_beans('tilkee_projects_tilkee_tilks', 'TILKEE_PROJECTS');
     $tilkee_project_id = 0;
     foreach ($projects_array as $project) {
         $tilkee_project_id = $project->tilkee_id;
     }
     if (!empty($tilkee_project_id)) {
         require_once 'custom/include/externalAPI/Tilkee/ExtAPITilkee.php';
         $tilkee = new ExtAPITilkee();
         $result = $tilkee->infos_tilk($tilkee_project_id, $this->tilkee_id);
         if ($result != -1 && !empty($result)) {
             // project updated : init bean
             $this->name = $result->title;
             $this->tilk_url = $result->url;
             $this->won = $result->won == 1 ? 'true' : 'false';
             $this->archived = !empty($result->archived_at) ? 'true' : 'false';
             $this->created_at = !empty($result->created_at) ? date('Y-m-d H:i:s', strtotime($result->created_at)) : '';
             $this->archived_at = !empty($result->archived_at) ? date('Y-m-d H:i:s', strtotime($result->archived_at)) : '';
             $this->last_sign_in_at = !empty($result->last_sign_in_at) ? date('Y-m-d H:i:s', strtotime($result->last_sign_in_at)) : '';
             $this->total_time = $this->convert_time($result->total_time);
             $this->total_connexion = $result->total_connexion;
             $this->save();
             // UPDATE LINKED CONNEXIONS
             if ($mode == 'update_connexions') {
                 global $beanFiles;
                 require_once $beanFiles['TILKEE_CONNEXIONS'];
                 $cur_connexions = new TILKEE_CONNEXIONS();
                 $cur_connexions->updateFromArray($this->id, $result->connexions);
             }
         } else {
             global $mod_strings;
             SugarApplication::appendErrorMessage($mod_strings['LBL_ERROR_SYNC_ON_TILKEE']);
             $GLOBALS['log']->fatal('TILKS sync_from_API -> ERROR RETRIEVE TILK INFOS FOR TILK : ' . $this->tilkee_id . ' - PROJECT : ' . $associated_project->tilkee_id);
         }
     }
     return 0;
 }