Exemple #1
0
 /**
  * Recreate ECO databaes tables from JSONConfig/eco.data.json
  * @throws Exception
  */
 public function generate()
 {
     if (!file_exists($this->getPgnFile())) {
         throw new Exception("Eco file " . $this->getPgnFile() . " does not exists");
     }
     if (!$this->exists()) {
         $this->createTable();
     }
     $this->deleteTableData()->yesImSure();
     LudoDBCache::clearByClass("Eco");
     $this->moveDataIntoJSONFile($this->getJSONData());
     $this->insertDefaultData();
 }
Exemple #2
0
 public function clearCache()
 {
     LudoDBCache::clearByClass('Capitals');
     parent::clearCache();
 }
 /**
  * Executes drop or deleteTableData
  * @example
  * $p = new Person();
  * $p->drop()->yesImSure();
  */
 public function yesImSure()
 {
     if (isset($this->riskyQuery)) {
         $this->db->query($this->riskyQuery);
         if ($this->shouldCache("read")) {
             LudoDBCache::clearByClass(get_class($this));
             $json = new LudoDBCache();
             $json->deleteTableData()->yesImSure();
         }
         $this->riskyQuery = null;
     }
 }
 protected function clearCache()
 {
     LudoDBCache::clearByClass("Folders");
 }