public function Save() { // use today's date if not set up if (is_null($this->created_on)) { $this->created_on = $this->GetMicrotime(); } return parent::Save(); }
protected function GetTableOptions() { return parent::GetTableOptions() . ',' . PHP_EOL . ' KEY occurrence_name (occurrence_id,name)'; }
/** * @param string $ar_class Name of class that extends ActiveRecord class. */ public function __construct($ar_class) { $this->ar_cls = $ar_class; $this->ar_obj = new $ar_class(); $this->from = array($this->ar_obj->GetTable()); }
/** * Uninstall plugin. */ public function Uninstall() { if ($this->GetGlobalOption("delete-data") == 1) { WSAL_DB_ActiveRecord::UninstallAll(); $this->deleteAllOptions(); } wp_clear_scheduled_hook('wsal_cleanup'); }
/** * Clear the cache. */ protected static function CacheClear() { self::$_cache = array(); }
/** * Uninstall plugin. */ public function Uninstall() { WSAL_DB_ActiveRecord::UninstallAll(); wp_clear_scheduled_hook('wsal_cleanup'); }
/** * Delete occurrence as well as associated meta data. * @return boolean True on success, false on failure. */ public function Delete() { foreach ($this->GetMeta() as $meta) { $meta->Delete(); } return parent::Delete(); }
/** * Uninstall plugin. */ public function Uninstall() { WSAL_DB_ActiveRecord::UninstallAll(); wp_unschedule_event(0, 'wsal_cleanup'); }