Happpi PHP Library

getCategoryPartsCount()

Returns the number of Parts in a category.

Return Type

int

Required Parameters

    getCategoryPartsCount(int $catID)

Optional Parameters

    getCategoryPartsCount(string $status)

Dependencies

    None

Example:

<!-- getCategoryPartsCount() -->
<?php
	require_once('libraries/happpi/LoadAll.php'); // points to the LoadAll.php file for loading the library.

	// once the library is required, you can now use one of the main "interaction" classes.
	// These interaction classes contain methods that get information from our REST API and
	// converts them to PHP objects for you to use.
	$Part = new CurtPart(); // create new part object to gain access to its functions.
	$numOfPartsInCategory = $Part->getCategoryPartsCount(3); // pass in a category ID of 3, to retrieve the number of parts in that category

	echo "<h2>Number of parts in category ID of 3.</h2>";	
	echo $numOfPartsInCategory; // display the number of parts.
	echo "<br />";
?>