PHP Class Trean_Bookmarks, horde

Author: Ben Chavet ([email protected])
Author: Chuck Hagenbuch ([email protected])
Author: Michael J Rubinsky ([email protected])
Mostra file Open project: horde/horde

Protected Properties

Property Type Description
$_userId integer
$_userManager Content_Users_Manager

Public Methods

Method Description
__construct ( Content_Users_Manager $userManager ) Constructor.
countBookmarks ( ) : integer Returns the number of bookmarks.
getBookmark ( integer $id ) : Trean_Bookmark Returns the bookmark corresponding to the given id.
getBookmarks ( array $ids, array $options = [] ) : array Returns the bookmarks corresponding to the given ids.
groupBookmarks ( string $groupby ) : array Return counts on grouping bookmarks by a specific property.
listBookmarks ( $sortby = 'title', integer $sortdir, integer $from, $count, string $userId = null ) : array List bookmarks, sorted and paged as specified.
newBookmark ( array $properties, boolean $crawl = true ) : Trean_Bookmark Create a new bookmark for the current user.
removeBookmark ( Trean_Bookmark $bookmark ) Removes a Trean_Bookmark from the backend.
searchBookmarks ( string $q ) : array Search bookmarks.

Protected Methods

Method Description
_resultSet ( array $bookmarks ) : array Creates Trean_Bookmark objects for each row in a SQL result.

Method Details

__construct() public method

Constructor.
public __construct ( Content_Users_Manager $userManager )
$userManager Content_Users_Manager

_resultSet() protected method

Creates Trean_Bookmark objects for each row in a SQL result.
protected _resultSet ( array $bookmarks ) : array
$bookmarks array An array of query results.
return array An array of Trean_Bookmark objects.

countBookmarks() public method

Returns the number of bookmarks.
public countBookmarks ( ) : integer
return integer The number of all bookmarks.

getBookmark() public method

Returns the bookmark corresponding to the given id.
public getBookmark ( integer $id ) : Trean_Bookmark
$id integer The ID of the bookmark to retrieve.
return Trean_Bookmark The bookmark object corresponding to the given name.

getBookmarks() public method

Returns the bookmarks corresponding to the given ids.
Since: 1.2.0
public getBookmarks ( array $ids, array $options = [] ) : array
$ids array
$options array An array of options: - sortby: (string) The field to sort by. DEFAULT: No sorting is done. - sortdir: (integer) The direction to sort, if sorting.
return array An array of Trean_Bookmark objects.

groupBookmarks() public method

Return counts on grouping bookmarks by a specific property.
public groupBookmarks ( string $groupby ) : array
$groupby string The field to group on. (i.e., 'status').
return array A hash of results.

listBookmarks() public method

List bookmarks, sorted and paged as specified.
public listBookmarks ( $sortby = 'title', integer $sortdir, integer $from, $count, string $userId = null ) : array
$sortdir integer Direction of sort.
$from integer Starting bookmark.
$userId string List bookmarks for this userId. Defaults to $this->_userId.
return array An array of Trean_Bookmark objects.

newBookmark() public method

Create a new bookmark for the current user.
public newBookmark ( array $properties, boolean $crawl = true ) : Trean_Bookmark
$properties array The bookmark property array.
$crawl boolean If true (default) attempt to crawl the URL.
return Trean_Bookmark

removeBookmark() public method

Removes a Trean_Bookmark from the backend.
public removeBookmark ( Trean_Bookmark $bookmark )
$bookmark Trean_Bookmark The bookmark to remove.

searchBookmarks() public method

Search bookmarks.
public searchBookmarks ( string $q ) : array
$q string The search text.
return array An array of Trean_Bookmark objects that match the search.

Property Details

$_userId protected_oe property

protected int $_userId
return integer

$_userManager protected_oe property

protected Content_Users_Manager $_userManager
return Content_Users_Manager