summaryrefslogtreecommitdiff
path: root/app/models/Category.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-04-17 19:05:53 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-04-17 19:05:53 +0200
commit392672ab2771c6d22f55017c4ed64a0e00945b23 (patch)
tree087ae495e38551392c94d942a4b6f32a7ebae015 /app/models/Category.php
parent6ce2b575eb501733e6936ac4b5f2e70d0f6ca13b (diff)
Fix issue #58 : possibilité de vider une catégorie
Diffstat (limited to 'app/models/Category.php')
-rwxr-xr-xapp/models/Category.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/models/Category.php b/app/models/Category.php
index ae803591f..7ce572e71 100755
--- a/app/models/Category.php
+++ b/app/models/Category.php
@@ -158,6 +158,20 @@ class CategoryDAO extends Model_pdo {
return HelperCategory::daoToCategory ($stm->fetchAll (PDO::FETCH_ASSOC));
}
+ public function getDefault () {
+ $sql = 'SELECT * FROM category WHERE id="000000"';
+ $stm = $this->bd->prepare ($sql);
+
+ $stm->execute ();
+ $res = $stm->fetchAll (PDO::FETCH_ASSOC);
+ $cat = HelperCategory::daoToCategory ($res);
+
+ if (isset ($cat[0])) {
+ return $cat[0];
+ } else {
+ return false;
+ }
+ }
public function checkDefault () {
$def_cat = $this->searchById ('000000');