Add bookmark exports and sharing + various fixes

This commit is contained in:
Joey Kimsey
2024-12-15 17:20:57 -05:00
parent 3ef97138a2
commit ab2f009e5b
26 changed files with 975 additions and 297 deletions

View File

@ -38,6 +38,20 @@ class Folders extends DatabaseModel {
parent::__construct();
}
public function findByUuid( $id ) {
$whereClause = ['uuid', '=', $id];
if ( empty( $limit ) ) {
$folders = self::$db->get( $this->tableName, $whereClause );
} else {
$folders = self::$db->get( $this->tableName, $whereClause, 'ID', 'DESC', [0, $limit] );
}
if ( !$folders->count() ) {
Debug::info( 'No Folders found.' );
return false;
}
return $this->filter( $folders->first() );
}
public function create( $title, $folderID = 0, $description = '', $color = 'default', $privacy = 'private', $user = null ) {
if ( empty( $user ) ) {
$user = App::$activeUser->ID;
@ -51,6 +65,7 @@ class Folders extends DatabaseModel {
'description' => $description,
'color' => $color,
'privacy' => $privacy,
'uuid' => generateUuidV4(),
'createdBy' => $user,
'createdAt' => time(),
];