Add bookmark exports and sharing + various fixes
This commit is contained in:
@ -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(),
|
||||
];
|
||||
|
Reference in New Issue
Block a user