Beispiel #1
0
 public function load(Database_Query_Builder_Select $query = NULL, $limit = 1)
 {
     parent::load($query, $limit);
     // Load the array as a Sprig object
     $this->loadarraydata();
     // Load the associated arraydata
     return $this;
 }
Beispiel #2
0
 /**
  * Handle deletion of expired token on load
  * @param Database_Query_Builder_Select $query [optional]
  * @param int                    	    $limit [optional]
  * @return Sprig
  */
 public function load(Database_Query_Builder_Select $query = NULL, $limit = 1)
 {
     parent::load($query, $limit);
     if ($limit === 1 and $this->loaded() and $this->expires < time()) {
         $this->delete();
         $this->_loaded = FALSE;
     }
     return $this;
 }
 public function load(Database_Query_Builder_Select $query = NULL, $limit = 1)
 {
     $this->gc();
     return parent::load($query, $limit);
 }
Beispiel #4
0
 /**
  * Ensure expired tokens are never loaded
  * Actual deletion is handled with delete_expired() ran with _init()
  * @param Database_Query_Builder_Select $query [optional]
  * @param int                    	    $limit [optional]
  * @return Sprig
  */
 public function load(Database_Query_Builder_Select $query = NULL, $limit = 1)
 {
     $query = isset($query) ? $query : DB::select();
     $query->where('expires', '>', time());
     return parent::load($query, $limit);
 }