private function _get_service_capacity($service_id) { // First, let's hack around the inflexible capacity getter :( $old_service = $this->_core->service; $this->_core->service = $service_id; // We can get the capacity now... $capacity = $this->_core->get_capacity(); // Revert the changes $this->_core->service = $old_service; // Deal with capacities return (int) $capacity; }