PHP Templating API: getDVDs()
Posted by Mark [Elevated X Support] on 26 October 2017 07:52 PM
Description:The getDVDs() function gets a list of DVDs that are present in the system. Based on the arguments that are passed to it will determine which and how many DVDs are returned.
$dvdobj = $api->getDVDs();
Returning Attributes:This function call will return a StdObject object with the following attributes:
dvds:This is a multi-dimensional array that returns any DVDs that match search criteria.
dvdcount:The number of sets within the dvds attribute.
numpages:A total number of pages that are available. For instance, if dvdtotal = 400 and the system has a numperpage value of 20, this value will be 20.
dvdtotal:A total number of DVDs that are available, regardless of pagination.
page:This paginates the DVD list. This way, if you specify "page" => 2, it will show a different list of DVDs than if you specify "page" => 1.
This is useful if the page you're calling this function on is paginated and you want to show different updates on page 2 of your page than page 1.
By default, the system sets this value to 1 if not specified when passing along to the system.
id:This filters the results by DVD id. If set, this will only return a set of the specified DVD id, if it is available for release and is present on the current site.
numperpage:If specified, determines the maximum number of results to show.
By default, the system looks at the value of "DVDs per page" under Plugins -> DVDs -> Configure.
studioid:If specified, only return DVDs that belong to the specified Studio Id.
By default, the returns all DVDs regardless of what Studio Id they are affiliated with.
startwith:If specified, only show DVDs that begin with the specified letter.
By default, the system does not filter results by letter.
sort:Specify sorting order of sets.
Valid values are: name, date, rating, random.
By default, the system will sort by date.
Note: Doing a database sort by random creates a temporary table within mysql, and may result in reduced performance. Only choose this sorting option when absolutely necessary.
sort_reverse:If this is set to 1, reverse the sorting order as specified within "sort"
subsiteid:If specified, limit DVDs belonging to a specified all-access subsite id. If this value is set to 0, show sets from all sites.
By default, the system will detect if the current area belongs to an all-access subsite, and use that value.
Note: If you specify a non-zero value for subsiteid, all-access must be available within this system. Otherwise, an Exception will be triggered.