diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2019-05-17 09:19:45 -0100 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2019-05-17 09:19:45 -0100 |
commit | ec822a440bbc9b81005921c6430640d5388e5289 (patch) | |
tree | d18c239a7dd38679001ffd5747f2b3988aa0b58f /lib/Db/FollowsRequest.php | |
parent | 1ad4d54ac76c54def69158669dd785dad3d2233e (diff) |
cleaning code
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib/Db/FollowsRequest.php')
-rw-r--r-- | lib/Db/FollowsRequest.php | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/Db/FollowsRequest.php b/lib/Db/FollowsRequest.php index ec8a7582..e3748819 100644 --- a/lib/Db/FollowsRequest.php +++ b/lib/Db/FollowsRequest.php @@ -54,8 +54,6 @@ class FollowsRequest extends FollowsRequestBuilder { * Insert a new Note in the database. * * @param Follow $follow - * - * @throws Exception */ public function save(Follow $follow) { $qb = $this->getFollowsInsertSql(); @@ -63,11 +61,15 @@ class FollowsRequest extends FollowsRequestBuilder { ->setValue('actor_id', $qb->createNamedParameter($follow->getActorId())) ->setValue('type', $qb->createNamedParameter($follow->getType())) ->setValue('object_id', $qb->createNamedParameter($follow->getObjectId())) - ->setValue('follow_id', $qb->createNamedParameter($follow->getFollowId())) - ->setValue( - 'creation', - $qb->createNamedParameter(new DateTime('now'), IQueryBuilder::PARAM_DATE) - ); + ->setValue('follow_id', $qb->createNamedParameter($follow->getFollowId())); + + try { + $qb->setValue( + 'creation', + $qb->createNamedParameter(new DateTime('now'), IQueryBuilder::PARAM_DATE) + ); + } catch (Exception $e) { + } $this->generatePrimaryKey($qb, $follow->getId()); |