aboutsummaryrefslogtreecommitdiff
path: root/app/class/modelart.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/class/modelart.php')
-rw-r--r--app/class/modelart.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/app/class/modelart.php b/app/class/modelart.php
index 8462675..8dee09c 100644
--- a/app/class/modelart.php
+++ b/app/class/modelart.php
@@ -11,6 +11,9 @@ class Modelart extends Modeldb
{
parent::__construct();
$this->storeinit(Config::arttable());
+ if(!$this->dircheck(Model::HTML_RENDER_DIR)) {
+ throw new Exception("Media error : Cant create /rendernew folder");
+ }
}
/**
@@ -50,7 +53,13 @@ class Modelart extends Modeldb
$this->repo->store($artdata);
}
-
+ /**
+ * Obtain a page object from the database
+ *
+ * @param Art2|string $id could be an Art2 object or a id string
+ *
+ * @return Art2|false The Art2 object or false if it does not exist.
+ */
public function get($id)
{
if ($id instanceof Art2) {
@@ -120,6 +129,9 @@ class Modelart extends Modeldb
unlink(Model::RENDER_DIR . $artid . $file);
}
}
+ if(file_exists(Model::HTML_RENDER_DIR . $artid . '.html')) {
+ unlink(Model::HTML_RENDER_DIR . $artid . '.html');
+ }
}
public function update(Art2 $art)