/** * Genera cache del modelo * @param string $model Nombre del modelo * @return null */ public static function generate($model) { $dirName = ROOT . DS . 'Cache'; if (!file_exists($dirName)) { mkdir($dirName, 0777, true); } chdir($dirName); $table = \Supernova\Inflector::camelToUnder(\Supernova\Inflector::pluralize($model)); $fields = \Supernova\Sql::getFields($table); file_put_contents($model, \Supernova\Crypt::encrypt(http_build_query($fields))); chmod($model, 0777); }
private function delete() { return \Supernova\Sql::removeResult($this); }