summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-05-28 18:19:15 -0400
committerFrederic Guillot <fred@kanboard.net>2016-05-28 18:19:15 -0400
commit936376ffe74c583d3cb819e98f53a85137fdf8bc (patch)
treed4a0fe65d34d21d898bf36818e8c1f4ba1846ffa
parente6235afb2d17baf31b6f6d67a0a51ac51243b909 (diff)
Remove model base class
-rw-r--r--app/Model/Action.php2
-rw-r--r--app/Model/ActionParameter.php2
-rw-r--r--app/Model/AvatarFile.php1
-rw-r--r--app/Model/Base.php34
-rw-r--r--app/Model/Board.php2
-rw-r--r--app/Model/Category.php4
-rw-r--r--app/Model/Color.php2
-rw-r--r--app/Model/Column.php4
-rw-r--r--app/Model/Comment.php4
-rw-r--r--app/Model/Currency.php2
-rw-r--r--app/Model/CustomFilter.php4
-rw-r--r--app/Model/File.php1
-rw-r--r--app/Model/Group.php4
-rw-r--r--app/Model/GroupMember.php2
-rw-r--r--app/Model/Language.php1
-rw-r--r--app/Model/LastLogin.php2
-rw-r--r--app/Model/Link.php1
-rw-r--r--app/Model/Metadata.php2
-rw-r--r--app/Model/Notification.php2
-rw-r--r--app/Model/NotificationType.php1
-rw-r--r--app/Model/PasswordReset.php2
-rw-r--r--app/Model/Project.php1
-rw-r--r--app/Model/ProjectActivity.php1
-rw-r--r--app/Model/ProjectDailyColumnStats.php2
-rw-r--r--app/Model/ProjectDailyStats.php2
-rw-r--r--app/Model/ProjectDuplication.php1
-rw-r--r--app/Model/ProjectFile.php2
-rw-r--r--app/Model/ProjectGroupRole.php1
-rw-r--r--app/Model/ProjectMetadata.php2
-rw-r--r--app/Model/ProjectNotification.php2
-rw-r--r--app/Model/ProjectNotificationType.php2
-rw-r--r--app/Model/ProjectPermission.php1
-rw-r--r--app/Model/ProjectUserRole.php1
-rw-r--r--app/Model/RememberMeSession.php1
-rw-r--r--app/Model/Setting.php2
-rw-r--r--app/Model/Subtask.php3
-rw-r--r--app/Model/SubtaskTimeTracking.php1
-rw-r--r--app/Model/Swimlane.php5
-rw-r--r--app/Model/Task.php2
-rw-r--r--app/Model/TaskAnalytic.php2
-rw-r--r--app/Model/TaskCreation.php3
-rw-r--r--app/Model/TaskDuplication.php1
-rw-r--r--app/Model/TaskExternalLink.php4
-rw-r--r--app/Model/TaskFinder.php1
-rw-r--r--app/Model/TaskLink.php1
-rw-r--r--app/Model/TaskModification.php1
-rw-r--r--app/Model/TaskPosition.php1
-rw-r--r--app/Model/TaskStatus.php1
-rw-r--r--app/Model/Timezone.php2
-rw-r--r--app/Model/Transition.php2
-rw-r--r--app/Model/User.php3
-rw-r--r--app/Model/UserLocking.php2
-rw-r--r--app/Model/UserMention.php1
-rw-r--r--app/Model/UserMetadata.php2
-rw-r--r--app/Model/UserNotification.php1
-rw-r--r--app/Model/UserNotificationFilter.php2
-rw-r--r--app/Model/UserNotificationType.php2
-rw-r--r--app/Model/UserUnreadNotification.php2
-rw-r--r--composer.json2
-rw-r--r--composer.lock19
60 files changed, 113 insertions, 53 deletions
diff --git a/app/Model/Action.php b/app/Model/Action.php
index f055d9d0..568ac85a 100644
--- a/app/Model/Action.php
+++ b/app/Model/Action.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* Action Model
*
diff --git a/app/Model/ActionParameter.php b/app/Model/ActionParameter.php
index 53edcbc8..a2fe74e5 100644
--- a/app/Model/ActionParameter.php
+++ b/app/Model/ActionParameter.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* Action Parameter Model
*
diff --git a/app/Model/AvatarFile.php b/app/Model/AvatarFile.php
index 9f47ccc7..cfb9e713 100644
--- a/app/Model/AvatarFile.php
+++ b/app/Model/AvatarFile.php
@@ -3,6 +3,7 @@
namespace Kanboard\Model;
use Exception;
+use Kanboard\Core\Base;
/**
* Avatar File
diff --git a/app/Model/Base.php b/app/Model/Base.php
deleted file mode 100644
index a27560c8..00000000
--- a/app/Model/Base.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-namespace Kanboard\Model;
-
-use PicoDb\Database;
-
-/**
- * Base model class
- *
- * @package model
- * @author Frederic Guillot
- */
-abstract class Base extends \Kanboard\Core\Base
-{
- /**
- * Save a record in the database
- *
- * @access public
- * @param string $table Table name
- * @param array $values Form values
- * @return boolean|integer
- */
- public function persist($table, array $values)
- {
- return $this->db->transaction(function (Database $db) use ($table, $values) {
-
- if (! $db->table($table)->save($values)) {
- return false;
- }
-
- return (int) $db->getLastId();
- });
- }
-}
diff --git a/app/Model/Board.php b/app/Model/Board.php
index d41ecafe..91acfb1b 100644
--- a/app/Model/Board.php
+++ b/app/Model/Board.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* Board model
*
diff --git a/app/Model/Category.php b/app/Model/Category.php
index 1d5f6546..00690a41 100644
--- a/app/Model/Category.php
+++ b/app/Model/Category.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* Category model
*
@@ -148,7 +150,7 @@ class Category extends Base
*/
public function create(array $values)
{
- return $this->persist(self::TABLE, $values);
+ return $this->db->table(self::TABLE)->persist($values);
}
/**
diff --git a/app/Model/Color.php b/app/Model/Color.php
index dee28643..025ca669 100644
--- a/app/Model/Color.php
+++ b/app/Model/Color.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* Color model
*
diff --git a/app/Model/Column.php b/app/Model/Column.php
index ccdcb049..329ff2d0 100644
--- a/app/Model/Column.php
+++ b/app/Model/Column.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* Column Model
*
@@ -140,7 +142,7 @@ class Column extends Base
'description' => $description,
);
- return $this->persist(self::TABLE, $values);
+ return $this->db->table(self::TABLE)->persist($values);
}
/**
diff --git a/app/Model/Comment.php b/app/Model/Comment.php
index c5091d89..7d3e1d6e 100644
--- a/app/Model/Comment.php
+++ b/app/Model/Comment.php
@@ -4,6 +4,8 @@ namespace Kanboard\Model;
use Kanboard\Event\CommentEvent;
+use Kanboard\Core\Base;
+
/**
* Comment model
*
@@ -110,7 +112,7 @@ class Comment extends Base
public function create(array $values)
{
$values['date_creation'] = time();
- $comment_id = $this->persist(self::TABLE, $values);
+ $comment_id = $this->db->table(self::TABLE)->persist($values);
if ($comment_id) {
$event = new CommentEvent(array('id' => $comment_id) + $values);
diff --git a/app/Model/Currency.php b/app/Model/Currency.php
index abcce2f0..7c8cadd4 100644
--- a/app/Model/Currency.php
+++ b/app/Model/Currency.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* Currency
*
diff --git a/app/Model/CustomFilter.php b/app/Model/CustomFilter.php
index 3a6a1a3a..9d409bd4 100644
--- a/app/Model/CustomFilter.php
+++ b/app/Model/CustomFilter.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* Custom Filter model
*
@@ -71,7 +73,7 @@ class CustomFilter extends Base
*/
public function create(array $values)
{
- return $this->persist(self::TABLE, $values);
+ return $this->db->table(self::TABLE)->persist($values);
}
/**
diff --git a/app/Model/File.php b/app/Model/File.php
index e383235c..92032110 100644
--- a/app/Model/File.php
+++ b/app/Model/File.php
@@ -3,6 +3,7 @@
namespace Kanboard\Model;
use Exception;
+use Kanboard\Core\Base;
use Kanboard\Core\Thumbnail;
use Kanboard\Event\FileEvent;
use Kanboard\Core\ObjectStorage\ObjectStorageException;
diff --git a/app/Model/Group.php b/app/Model/Group.php
index 24dc432b..25579206 100644
--- a/app/Model/Group.php
+++ b/app/Model/Group.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* Group Model
*
@@ -97,7 +99,7 @@ class Group extends Base
*/
public function create($name, $external_id = '')
{
- return $this->persist(self::TABLE, array(
+ return $this->db->table(self::TABLE)->persist(array(
'name' => $name,
'external_id' => $external_id,
));
diff --git a/app/Model/GroupMember.php b/app/Model/GroupMember.php
index baf303c4..a0bbb9f8 100644
--- a/app/Model/GroupMember.php
+++ b/app/Model/GroupMember.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* Group Member Model
*
diff --git a/app/Model/Language.php b/app/Model/Language.php
index 441771e0..126dc5c0 100644
--- a/app/Model/Language.php
+++ b/app/Model/Language.php
@@ -2,6 +2,7 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
use Kanboard\Core\Translator;
/**
diff --git a/app/Model/LastLogin.php b/app/Model/LastLogin.php
index feb5f5a3..35c7afc9 100644
--- a/app/Model/LastLogin.php
+++ b/app/Model/LastLogin.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* LastLogin model
*
diff --git a/app/Model/Link.php b/app/Model/Link.php
index 903a98d6..f275edae 100644
--- a/app/Model/Link.php
+++ b/app/Model/Link.php
@@ -3,6 +3,7 @@
namespace Kanboard\Model;
use PDO;
+use Kanboard\Core\Base;
/**
* Link model
diff --git a/app/Model/Metadata.php b/app/Model/Metadata.php
index 52f6b009..b39ce098 100644
--- a/app/Model/Metadata.php
+++ b/app/Model/Metadata.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* Metadata
*
diff --git a/app/Model/Notification.php b/app/Model/Notification.php
index c252aa31..1e96a8b4 100644
--- a/app/Model/Notification.php
+++ b/app/Model/Notification.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* Notification
*
diff --git a/app/Model/NotificationType.php b/app/Model/NotificationType.php
index 289aae9c..a4dffa09 100644
--- a/app/Model/NotificationType.php
+++ b/app/Model/NotificationType.php
@@ -3,6 +3,7 @@
namespace Kanboard\Model;
use Pimple\Container;
+use Kanboard\Core\Base;
/**
* Notification Type
diff --git a/app/Model/PasswordReset.php b/app/Model/PasswordReset.php
index 5cfd3c97..895acb07 100644
--- a/app/Model/PasswordReset.php
+++ b/app/Model/PasswordReset.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* Password Reset Model
*
diff --git a/app/Model/Project.php b/app/Model/Project.php
index 9843a54c..2cb0a431 100644
--- a/app/Model/Project.php
+++ b/app/Model/Project.php
@@ -2,6 +2,7 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
use Kanboard\Core\Security\Token;
use Kanboard\Core\Security\Role;
diff --git a/app/Model/ProjectActivity.php b/app/Model/ProjectActivity.php
index d993015b..f6bdbf92 100644
--- a/app/Model/ProjectActivity.php
+++ b/app/Model/ProjectActivity.php
@@ -2,6 +2,7 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
use PicoDb\Table;
/**
diff --git a/app/Model/ProjectDailyColumnStats.php b/app/Model/ProjectDailyColumnStats.php
index 0706a110..38487c76 100644
--- a/app/Model/ProjectDailyColumnStats.php
+++ b/app/Model/ProjectDailyColumnStats.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* Project Daily Column Stats
*
diff --git a/app/Model/ProjectDailyStats.php b/app/Model/ProjectDailyStats.php
index 974f5813..08a0039e 100644
--- a/app/Model/ProjectDailyStats.php
+++ b/app/Model/ProjectDailyStats.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* Project Daily Stats
*
diff --git a/app/Model/ProjectDuplication.php b/app/Model/ProjectDuplication.php
index 79011258..871cadc8 100644
--- a/app/Model/ProjectDuplication.php
+++ b/app/Model/ProjectDuplication.php
@@ -2,6 +2,7 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
use Kanboard\Core\Security\Role;
/**
diff --git a/app/Model/ProjectFile.php b/app/Model/ProjectFile.php
index aa9bf15b..75348e0c 100644
--- a/app/Model/ProjectFile.php
+++ b/app/Model/ProjectFile.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* Project File Model
*
diff --git a/app/Model/ProjectGroupRole.php b/app/Model/ProjectGroupRole.php
index afad4a44..3ce2b1dc 100644
--- a/app/Model/ProjectGroupRole.php
+++ b/app/Model/ProjectGroupRole.php
@@ -2,6 +2,7 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
use Kanboard\Core\Security\Role;
/**
diff --git a/app/Model/ProjectMetadata.php b/app/Model/ProjectMetadata.php
index 2b3aadf5..c8e4fe63 100644
--- a/app/Model/ProjectMetadata.php
+++ b/app/Model/ProjectMetadata.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* Project Metadata
*
diff --git a/app/Model/ProjectNotification.php b/app/Model/ProjectNotification.php
index a355902f..5df042ca 100644
--- a/app/Model/ProjectNotification.php
+++ b/app/Model/ProjectNotification.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* Project Notification
*
diff --git a/app/Model/ProjectNotificationType.php b/app/Model/ProjectNotificationType.php
index a4719598..a00e465c 100644
--- a/app/Model/ProjectNotificationType.php
+++ b/app/Model/ProjectNotificationType.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* Project Notification Type
*
diff --git a/app/Model/ProjectPermission.php b/app/Model/ProjectPermission.php
index 59af2b58..bc35c956 100644
--- a/app/Model/ProjectPermission.php
+++ b/app/Model/ProjectPermission.php
@@ -2,6 +2,7 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
use Kanboard\Core\Security\Role;
use Kanboard\Filter\ProjectGroupRoleProjectFilter;
use Kanboard\Filter\ProjectGroupRoleUsernameFilter;
diff --git a/app/Model/ProjectUserRole.php b/app/Model/ProjectUserRole.php
index db26fd5f..05f96c6e 100644
--- a/app/Model/ProjectUserRole.php
+++ b/app/Model/ProjectUserRole.php
@@ -2,6 +2,7 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
use Kanboard\Core\Security\Role;
/**
diff --git a/app/Model/RememberMeSession.php b/app/Model/RememberMeSession.php
index 8989a6d7..e3f2f132 100644
--- a/app/Model/RememberMeSession.php
+++ b/app/Model/RememberMeSession.php
@@ -2,6 +2,7 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
use Kanboard\Core\Security\Token;
/**
diff --git a/app/Model/Setting.php b/app/Model/Setting.php
index c5a4765c..38af22e0 100644
--- a/app/Model/Setting.php
+++ b/app/Model/Setting.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* Application Settings
*
diff --git a/app/Model/Subtask.php b/app/Model/Subtask.php
index e56796a0..1d53d6de 100644
--- a/app/Model/Subtask.php
+++ b/app/Model/Subtask.php
@@ -3,6 +3,7 @@
namespace Kanboard\Model;
use PicoDb\Database;
+use Kanboard\Core\Base;
use Kanboard\Event\SubtaskEvent;
/**
@@ -215,7 +216,7 @@ class Subtask extends Base
public function create(array $values)
{
$this->prepareCreation($values);
- $subtask_id = $this->persist(self::TABLE, $values);
+ $subtask_id = $this->db->table(self::TABLE)->persist($values);
if ($subtask_id) {
$this->container['dispatcher']->dispatch(
diff --git a/app/Model/SubtaskTimeTracking.php b/app/Model/SubtaskTimeTracking.php
index be04ee1b..8b5d2545 100644
--- a/app/Model/SubtaskTimeTracking.php
+++ b/app/Model/SubtaskTimeTracking.php
@@ -3,6 +3,7 @@
namespace Kanboard\Model;
use DateTime;
+use Kanboard\Core\Base;
/**
* Subtask timesheet
diff --git a/app/Model/Swimlane.php b/app/Model/Swimlane.php
index 721f20d3..8efe68da 100644
--- a/app/Model/Swimlane.php
+++ b/app/Model/Swimlane.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* Swimlanes
*
@@ -225,8 +227,9 @@ class Swimlane extends Base
if (! $this->project->exists($values['project_id'])) {
return 0;
}
+
$values['position'] = $this->getLastPosition($values['project_id']);
- return $this->persist(self::TABLE, $values);
+ return $this->db->table(self::TABLE)->persist($values);
}
/**
diff --git a/app/Model/Task.php b/app/Model/Task.php
index f8b41b9f..bdb55c46 100644
--- a/app/Model/Task.php
+++ b/app/Model/Task.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* Task model
*
diff --git a/app/Model/TaskAnalytic.php b/app/Model/TaskAnalytic.php
index cff56744..bf118b4e 100644
--- a/app/Model/TaskAnalytic.php
+++ b/app/Model/TaskAnalytic.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* Task Analytic
*
diff --git a/app/Model/TaskCreation.php b/app/Model/TaskCreation.php
index 2d2e5504..2abfd95c 100644
--- a/app/Model/TaskCreation.php
+++ b/app/Model/TaskCreation.php
@@ -2,6 +2,7 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
use Kanboard\Event\TaskEvent;
/**
@@ -28,7 +29,7 @@ class TaskCreation extends Base
$position = empty($values['position']) ? 0 : $values['position'];
$this->prepare($values);
- $task_id = $this->persist(Task::TABLE, $values);
+ $task_id = $this->db->table(Task::TABLE)->persist($values);
if ($task_id !== false) {
if ($position > 0 && $values['position'] > 1) {
diff --git a/app/Model/TaskDuplication.php b/app/Model/TaskDuplication.php
index ebdd4d29..56457a01 100644
--- a/app/Model/TaskDuplication.php
+++ b/app/Model/TaskDuplication.php
@@ -4,6 +4,7 @@ namespace Kanboard\Model;
use DateTime;
use DateInterval;
+use Kanboard\Core\Base;
use Kanboard\Event\TaskEvent;
/**
diff --git a/app/Model/TaskExternalLink.php b/app/Model/TaskExternalLink.php
index f2c756b4..f77a72bf 100644
--- a/app/Model/TaskExternalLink.php
+++ b/app/Model/TaskExternalLink.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* Task External Link Model
*
@@ -69,7 +71,7 @@ class TaskExternalLink extends Base
$values['date_creation'] = time();
$values['date_modification'] = $values['date_creation'];
- return $this->persist(self::TABLE, $values);
+ return $this->db->table(self::TABLE)->persist($values);
}
/**
diff --git a/app/Model/TaskFinder.php b/app/Model/TaskFinder.php
index f8566bc2..fed3a580 100644
--- a/app/Model/TaskFinder.php
+++ b/app/Model/TaskFinder.php
@@ -3,6 +3,7 @@
namespace Kanboard\Model;
use PDO;
+use Kanboard\Core\Base;
/**
* Task Finder model
diff --git a/app/Model/TaskLink.php b/app/Model/TaskLink.php
index e46ea476..9c5b3ca3 100644
--- a/app/Model/TaskLink.php
+++ b/app/Model/TaskLink.php
@@ -2,6 +2,7 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
use Kanboard\Event\TaskLinkEvent;
/**
diff --git a/app/Model/TaskModification.php b/app/Model/TaskModification.php
index a77b78a4..7e0ea8b2 100644
--- a/app/Model/TaskModification.php
+++ b/app/Model/TaskModification.php
@@ -2,6 +2,7 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
use Kanboard\Event\TaskEvent;
/**
diff --git a/app/Model/TaskPosition.php b/app/Model/TaskPosition.php
index 4c9928d7..5b794795 100644
--- a/app/Model/TaskPosition.php
+++ b/app/Model/TaskPosition.php
@@ -2,6 +2,7 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
use Kanboard\Event\TaskEvent;
/**
diff --git a/app/Model/TaskStatus.php b/app/Model/TaskStatus.php
index ac35a96d..4ba13a60 100644
--- a/app/Model/TaskStatus.php
+++ b/app/Model/TaskStatus.php
@@ -2,6 +2,7 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
use Kanboard\Event\TaskEvent;
/**
diff --git a/app/Model/Timezone.php b/app/Model/Timezone.php
index c6b33736..de426e79 100644
--- a/app/Model/Timezone.php
+++ b/app/Model/Timezone.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* Class Timezone
*
diff --git a/app/Model/Transition.php b/app/Model/Transition.php
index 870d95fd..2bc622b0 100644
--- a/app/Model/Transition.php
+++ b/app/Model/Transition.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* Transition
*
diff --git a/app/Model/User.php b/app/Model/User.php
index 6dd78dbb..cbfca0ac 100644
--- a/app/Model/User.php
+++ b/app/Model/User.php
@@ -3,6 +3,7 @@
namespace Kanboard\Model;
use PicoDb\Database;
+use Kanboard\Core\Base;
use Kanboard\Core\Security\Token;
use Kanboard\Core\Security\Role;
@@ -269,7 +270,7 @@ class User extends Base
public function create(array $values)
{
$this->prepare($values);
- return $this->persist(self::TABLE, $values);
+ return $this->db->table(self::TABLE)->persist($values);
}
/**
diff --git a/app/Model/UserLocking.php b/app/Model/UserLocking.php
index 67e4c244..ccaf402c 100644
--- a/app/Model/UserLocking.php
+++ b/app/Model/UserLocking.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* User Locking Model
*
diff --git a/app/Model/UserMention.php b/app/Model/UserMention.php
index 97a4e419..42b81840 100644
--- a/app/Model/UserMention.php
+++ b/app/Model/UserMention.php
@@ -2,6 +2,7 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
use Kanboard\Event\GenericEvent;
/**
diff --git a/app/Model/UserMetadata.php b/app/Model/UserMetadata.php
index 8b880756..491c1575 100644
--- a/app/Model/UserMetadata.php
+++ b/app/Model/UserMetadata.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* User Metadata
*
diff --git a/app/Model/UserNotification.php b/app/Model/UserNotification.php
index 6882e671..ef90bb63 100644
--- a/app/Model/UserNotification.php
+++ b/app/Model/UserNotification.php
@@ -2,6 +2,7 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
use Kanboard\Core\Translator;
/**
diff --git a/app/Model/UserNotificationFilter.php b/app/Model/UserNotificationFilter.php
index 780ddfc7..d885da04 100644
--- a/app/Model/UserNotificationFilter.php
+++ b/app/Model/UserNotificationFilter.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* User Notification Filter
*
diff --git a/app/Model/UserNotificationType.php b/app/Model/UserNotificationType.php
index 89beb480..d84cc690 100644
--- a/app/Model/UserNotificationType.php
+++ b/app/Model/UserNotificationType.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* User Notification Type
*
diff --git a/app/Model/UserUnreadNotification.php b/app/Model/UserUnreadNotification.php
index 42893666..f3fcd601 100644
--- a/app/Model/UserUnreadNotification.php
+++ b/app/Model/UserUnreadNotification.php
@@ -2,6 +2,8 @@
namespace Kanboard\Model;
+use Kanboard\Core\Base;
+
/**
* User Unread Notification
*
diff --git a/composer.json b/composer.json
index 16460f27..44c54394 100644
--- a/composer.json
+++ b/composer.json
@@ -27,7 +27,7 @@
"eluceo/ical": "0.8.0",
"erusev/parsedown" : "1.6.0",
"fguillot/json-rpc" : "1.1.0",
- "fguillot/picodb" : "1.0.11",
+ "fguillot/picodb" : "1.0.12",
"fguillot/simpleLogger" : "1.0.1",
"fguillot/simple-validator" : "1.0.0",
"fguillot/simple-queue" : "dev-master",
diff --git a/composer.lock b/composer.lock
index 48dd7640..ae02c42f 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "hash": "d9622d90bef6f3316b84a374fc73f1d0",
- "content-hash": "593b137facd6a5d8fc4b8f4838b99ddb",
+ "hash": "1dff423870fc9d85edd75f83ee0b5b97",
+ "content-hash": "5a7a28b3dcb87b0be20ff634d989d5b4",
"packages": [
{
"name": "christian-riesen/base32",
@@ -239,21 +239,24 @@
},
{
"name": "fguillot/picodb",
- "version": "v1.0.11",
+ "version": "v1.0.12",
"source": {
"type": "git",
"url": "https://github.com/fguillot/picoDb.git",
- "reference": "5f6485c1a930ff22f14bcbf6db8b95d55efe6c52"
+ "reference": "dd088cb75e9035d083f511cdc77b268bc8e110b6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/fguillot/picoDb/zipball/5f6485c1a930ff22f14bcbf6db8b95d55efe6c52",
- "reference": "5f6485c1a930ff22f14bcbf6db8b95d55efe6c52",
+ "url": "https://api.github.com/repos/fguillot/picoDb/zipball/dd088cb75e9035d083f511cdc77b268bc8e110b6",
+ "reference": "dd088cb75e9035d083f511cdc77b268bc8e110b6",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
+ "require-dev": {
+ "phpunit/phpunit": "4.8.*"
+ },
"type": "library",
"autoload": {
"psr-0": {
@@ -267,12 +270,12 @@
"authors": [
{
"name": "Frédéric Guillot",
- "homepage": "http://fredericguillot.com"
+ "homepage": "https://github.com/fguillot/"
}
],
"description": "Minimalist database query builder",
"homepage": "https://github.com/fguillot/picoDb",
- "time": "2016-05-15 01:02:48"
+ "time": "2016-05-28 22:00:54"
},
{
"name": "fguillot/simple-queue",