Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
#3818 change methods visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
kduret committed Oct 13, 2015
1 parent b4dd29b commit 79ff4bf
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
8 changes: 4 additions & 4 deletions www/class/config-generate/contact.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ class Contact extends AbstractObject {
private $use_cache = 1;
private $done_cache = 0;
private $contacts_service_linked_cache = array();
private $contacts_cache = array();
private $contacts = array();
protected $contacts_cache = array();
protected $contacts = array();
protected $generate_filename = 'contacts.cfg';
protected $object_name = 'contact';
protected $attributes_select = '
Expand Down Expand Up @@ -109,7 +109,7 @@ public function getContactForService($service_id) {
return $this->contacts_service_linked_cache[$service_id];
}

private function getContactFromId($contact_id) {
protected function getContactFromId($contact_id) {
if (is_null($this->stmt_contact)) {
$this->stmt_contact = $this->backend_instance->db->prepare("SELECT
$this->attributes_select
Expand Down Expand Up @@ -149,7 +149,7 @@ protected function getContactNotificationCommands($contact_id, $label) {
}
}

private function buildCache() {
protected function buildCache() {
if ($this->done_cache == 1) {
return 0;
}
Expand Down
13 changes: 7 additions & 6 deletions www/class/config-generate/contactgroup.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ class Contactgroup extends AbstractObject {
private $use_cache = 1;
private $done_cache = 0;
private $cg_service_linked_cache = array();
private $cg_cache = array();
private $cg = null;
protected $cg_cache = array();
protected $cg = null;
protected $generate_filename = 'contactgroups.cfg';
protected $object_name = 'contactgroup';
protected $attributes_select = '
Expand All @@ -24,7 +24,7 @@ class Contactgroup extends AbstractObject {
protected $stmt_contact = null;
protected $stmt_cg_service = null;

private function getCgCache() {
protected function getCgCache() {
$stmt = $this->backend_instance->db->prepare("SELECT
$this->attributes_select
FROM contactgroup
Expand All @@ -49,7 +49,7 @@ private function getCgForServiceCache() {
}
}

private function buildCache() {
protected function buildCache() {
if ($this->done_cache == 1) {
return 0;
}
Expand Down Expand Up @@ -84,7 +84,7 @@ public function getCgForService($service_id) {
return $this->cg_service_linked_cache[$service_id];
}

private function getCgFromId($cg_id) {
public function getCgFromId($cg_id) {
if (is_null($this->stmt_cg)) {
$this->stmt_cg = $this->backend_instance->db->prepare("SELECT
$this->attributes_select
Expand All @@ -96,9 +96,10 @@ private function getCgFromId($cg_id) {
$this->stmt_cg->execute();
$results = $this->stmt_cg->fetchAll(PDO::FETCH_ASSOC);
$this->cg[$cg_id] = array_pop($results);
return $this->cg[$cg_id];
}

protected function getContactFromCgId($cg_id) {
public function getContactFromCgId($cg_id) {
if (!isset($this->cg[$cg_id]['members_cache'])) {
if (is_null($this->stmt_contact)) {
$this->stmt_contact = $this->backend_instance->db->prepare("SELECT
Expand Down
4 changes: 4 additions & 0 deletions www/class/config-generate/host.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ protected function getSeverity($host_id_arg) {
# For applied on services without severity
$this->hosts[$host_id_arg]['severity_id_for_services'] = $severity_instance->getHostSeverityById($severity_id);
}

public function addHost($host_id, $attr = array()) {
$this->hosts[$host_id] = $attr;
}

private function getHosts($poller_id) {
# We use host_register = 1 because we don't want _Module_* hosts
Expand Down
6 changes: 5 additions & 1 deletion www/class/config-generate/service.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ private function getServiceCache() {
$stmt->execute();
$this->service_cache = $stmt->fetchAll(PDO::FETCH_GROUP|PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC);
}

public function addServiceCache($service_id, $attr = array()) {
$this->service_cache[$service_id] = $attr;
}

private function getServiceFromId($service_id) {
if (is_null($this->stmt_service)) {
Expand Down Expand Up @@ -208,7 +212,7 @@ private function clean(&$service) {
}
}

private function addGeneratedServices($host_id, $service_id) {
public function addGeneratedServices($host_id, $service_id) {
if (!isset($this->generated_services[$host_id])) {
$this->generated_services[$host_id] = array();
}
Expand Down

0 comments on commit 79ff4bf

Please sign in to comment.