BMLT Root Server
c_comdef_service_bodies.class.php
Go to the documentation of this file.
1 <?php
2 /***********************************************************************/
3 /** \file c_comdef_service_bodies.class.php
4  \brief The file for the c_comdef_service_bodies class.
5 
6  This file is part of the Basic Meeting List Toolbox (BMLT).
7 
8  Find out more at: https://bmlt.app
9 
10  BMLT is free software: you can redistribute it and/or modify
11  it under the terms of the MIT License.
12 
13  BMLT is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  MIT License for more details.
17 
18  You should have received a copy of the MIT License along with this code.
19  If not, see <https://opensource.org/licenses/MIT>.
20 */
21 defined('BMLT_EXEC') or die('Cannot Execute Directly'); // Makes sure that this file is in the correct context.
22 
23 require_once(dirname(__FILE__)."/c_comdef_service_body.class.php");
24 
25 /***********************************************************************/
26 /** \class c_comdef_service_bodies
27  \brief A class to hold a collection of c_comdef_service_body objects.
28 
29 ***********************************************************************/
30 // phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
31 // phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
33 // phpcs:enable PSR1.Classes.ClassDeclaration.MissingNamespace
34 // phpcs:enable Squiz.Classes.ValidClassName.NotCamelCaps
35 {
36  /// This is the parent (container) object that holds this instance.
37  private $_local_id_parent_obj = null;
38 
39  /*******************************************************************/
40  /** We keep a local copy of the simple array, because we can instantly
41  access it, as opposed to having to instantiate iterators.
42  */
43  private $_local_copy_of_array = null;
44 
45  public function __construct(
46  $in_parent_object, ///< A reference to the object that "owns" this instance.
47  $in_service_body_object_array ///< An array of references to c_comdef_service_body objects, to be stored as local references.
48  ) {
49  $this->SetParentObj($in_parent_object);
50 
51  foreach ($in_service_body_object_array as &$obj) {
52  // Who's yer daddy?
53  $obj->SetParentObj($this);
54  }
55  $this->_local_copy_of_array = $in_service_body_object_array;
56  }
57 
58  /*******************************************************************/
59  /** \brief Set the parent object of this instance.
60  */
61  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
62  public function SetParentObj(
63  $in_parent_obj ///< A reference to the parent object.
64  ) {
65  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
66  $this->_local_id_parent_obj = null;
67  $this->_local_id_parent_obj = $in_parent_obj;
68  }
69 
70  /*******************************************************************/
71  /** \brief Return a reference to the parent object of this instance.
72 
73  \returns a reference to the parent instance of the object.
74  */
75  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
76  public function GetParentObj()
77  {
78  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
79  return $this->_local_id_parent_obj;
80  }
81 
82  /*******************************************************************/
83  /** \brief Accessor -Get the service body object array.
84 
85  \returns a reference to an array of c_comdef_service_body objects.
86  */
87  // phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
88  public function &GetServiceBodiesArray()
89  {
90  // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
91  return $this->_local_copy_of_array;
92  }
93 }
A Class for Service Body Objects.
SetParentObj($in_parent_obj)
Set the parent object of this instance.
__construct($in_parent_object, $in_service_body_object_array)
GetParentObj()
Return a reference to the parent object of this instance.
Simply declares an interface for having a "container" object.
& GetServiceBodiesArray()
Accessor -Get the service body object array.
defined('BMLT_EXEC') or define('BMLT_EXEC'
Definition: index.php:3
A class to hold a collection of c_comdef_service_body objects.