Skip to content

Documentation is sorely needed #14

Description

@delovelady

While this API has wonderful promise, based on the overview, lack of documentation makes it very difficult if not impossible to use practically.

Case in point, the following code:

$filter1 = new Filter('title', $favoriteTitle) ;
foreach($librarySections['Directory'] as $directoryNumber => $directoryAttributes) {
    ($type = $directoryAttributes['type'] != 'movie')
        continue ;
    $sectionNumber = $directoryAttributes['key'] ;
    $res = $client->filter($sectionNumber, [$filter1], true) ;  // Note: This results in three warnings about Video not being an index in jc21/plex-api/src/jc21/PlexApi.php on line 405
    if ($res) {
        foreach ($res as $movie) {
            $a=$movie->title ;
            // how to access the elements of movie?
                //foreach ($movie->data as $element) {} // Exception Return value of jc21\Movies\Movie::__get() must be an instance of jc21\Movies\mixed, null returned
                //foreach ($movie as $element) {} // Loop does not get entered
                //$title = $movie['title'] ; Exception Cannot use object of type jc21\Movies\Movie as array
                //$title = $movie->title : Exception TypeError: Return value of jc21\Movies\Movie::__get() must be an instance of jc21\Movies\mixed, string returned
                //$movie->toArray() results in undefined function
                //$array = $movie->jsonSerialize() ; Exception Return value of jc21\Movies\Movie::jsonSerialize() must be an instance of jc21\Movies\mixed, array returned
            }
        }

It's not at all clear where to go once the $movie object has been created. Here's the result of the $title = $movie->title effort:
Screen Shot 2022-08-29 at 9 30 24 AM

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions