/** * Counts all associated InventoryModels * @return int */ public function CountInventoryModels() { if (is_null($this->intCategoryId)) { return 0; } return InventoryModel::CountByCategoryId($this->intCategoryId); }