Skip to content

Commit

Permalink
refactor (bookmark): mark bookmark functions as deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
c0nst4ntin committed Jan 2, 2025
1 parent be7a513 commit b490c9a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/Prismic/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ public function getRefFromLabel(string $label) :? Ref
* Returns the list of all bookmarks on the repository. If you're looking
* for a document from it's bookmark name, you should use the bookmark() function.
*
* @deprecated 5.4.0 This method will no longer work after the 12 February 2025, as bookmarks are removed from the API.
*
* @return array the array of bookmarks
*/
public function bookmarks() : array
Expand All @@ -165,6 +167,8 @@ public function bookmarks() : array
* Most starter projects embed a helper to query a document from their ID string,
* which makes this even easier.
*
* @deprecated 5.4.0 This method will no longer work after the 12 February 2025, as bookmarks are removed from the API.
*
* @param string $name the bookmark name to use
*
* @return string|null the ID string for a given bookmark name
Expand Down
9 changes: 7 additions & 2 deletions src/Prismic/ApiData.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ class ApiData

/**
* An array of the available bookmarks
*
* @deprecated 5.4.0
*
* @var array
*/
private $bookmarks;
Expand Down Expand Up @@ -66,7 +69,7 @@ class ApiData
* A constructor to build the object when you've retrieved all the data you need.
*
* @param array $refs
* @param array $bookmarks
* @param array $bookmarks (deprecated since 5.4.0)
* @param array $types
* @param array $languages
* @param array $tags
Expand Down Expand Up @@ -131,7 +134,7 @@ function ($ref) {
},
$json->refs
),
(array)$json->bookmarks,
isset($json->bookmarks) ? (array)$json->bookmarks : [],
(array)$json->types,
array_map(
function ($language) {
Expand All @@ -158,6 +161,8 @@ public function getRefs() : array

/**
* Get the bookmarks
*
* @deprecated 5.4.0 This method will no longer work after the 12 February 2025, as bookmarks are removed from the API.
*/
public function getBookmarks() : array
{
Expand Down

0 comments on commit b490c9a

Please sign in to comment.