/** * @brief Get the "disable automatic datasheets" attribute * * @param boolean $including_parents @li If true, this method will return a "true" if at least * one parent category has set "disable_autodatasheets == true" * @li If false, this method will only return that value * which is stored in the database * * @retval boolean the "disable automatic datasheets" attribute */ public function get_disable_autodatasheets($including_parents = false) { if ($including_parents) { $parent_id = $this->get_id(); while ($parent_id > 0) { $category = new Category($this->database, $this->current_user, $this->log, $parent_id); $parent_id = $category->get_parent_id(); if ($category->get_disable_autodatasheets()) { return true; } } return false; } else { return $this->db_data['disable_autodatasheets']; } }