Exemple #1
0
 /**
  * Construct a new sync object
  * - this will be automatically put into the database for sending unless $target is false
  */
 function __construct($crud = null, $fields = null, $target = null)
 {
     if ($fields && array_key_exists('type', $fields) && $fields['type'] == LG_SYNC) {
         die('Can\'t construct sync object containing a sync object!');
     }
     $this->type = LG_SYNC;
     parent::__construct();
     // We have to allow construction with no args so newFromFields can work
     if (is_null($crud)) {
         return;
     }
     // Set the cmd and data
     if (is_null($fields) || is_null($target)) {
         die('fields and target are mandatory parameters for LG_SYNC object construction');
     }
     if ($target) {
         $this->ref1 = $target->id;
     }
     if ($crud == 'U') {
         $this->ref2 = $fields['id'];
     }
     $this->tag = $crud;
     $this->data = $fields;
     // Sync objects are always unconditionally local
     $this->flag(LG_LOCAL, true);
     // Store the new object in the database (if it has a target)
     if ($target) {
         $this->update();
     }
 }
Exemple #2
0
 function __construct($version = false)
 {
     $this->type = LG_VERSION;
     parent::__construct();
     if ($version) {
         $this->tag = $version;
         $this->update();
     }
 }
Exemple #3
0
 function __construct($message = false, $tag = '', $expire = false)
 {
     // This goes first so that parent constructor will raise an error if the current uuid type doesn't match
     $this->type = LG_LOG;
     // Give the new object an ID
     parent::__construct();
     if ($message) {
         // Set the cmd and data
         $this->ref1 = LigminchaGlobalServer::getCurrent()->id;
         $this->tag = $tag;
         $this->data = $message;
         $this->expire = $expire;
         // Store the new log entry in the database
         $this->update();
     }
 }
Exemple #4
0
 function __construct()
 {
     $this->type = LG_SESSION;
     parent::__construct();
 }
Exemple #5
0
 function __construct()
 {
     $this->type = LG_USER;
     parent::__construct();
 }
Exemple #6
0
 function __construct()
 {
     $this->checkMaster();
     $this->type = LG_SERVER;
     parent::__construct();
 }