8
* Returns the specified object for use (raw get).
10
* @param $objectName - the name of the object to get
11
* @return CoughObject - the requested object
12
* @author Anthony Bush
14
protected function rawGetObject($objectName) {
15
if ( ! $this->isObjectLoaded($objectName)) {
16
$this->loadObject($objectName);
18
return $this->objects[$objectName];
22
* Calls the get method for the given object name.
25
* @author Anthony Bush
27
public function getObject($objectName) {
28
$getMethod = 'get' . self::titleCase($objectName) . '_Object';
29
return $this->$getMethod();
33
* Sets the object reference in memory (raw set).
35
* This has no effect on the database. For example:
37
* $order->setCustomer($customer);
39
* will not change the customer_id on the order. It is simply a way to pass
40
* in pre-instantiated objects so that they do not have to be looked up in
44
* @author Anthony Bush
46
protected function rawSetObject($objectName, $object) {
47
if (isset($this->objectDefinitions[$objectName])) {
48
$this->objects[$objectName] = $object;
53
* Calls the set method for the given object name.
56
* @author Anthony Bush
58
public function setObject($objectName, $object) {
59
$setMethod = 'set' . self::titleCase($objectName) . '_Object';
60
$this->$setMethod($object);
64
* Returns the current value of the requested field name.
68
protected function rawGetField($fieldName) {
69
if (isset($this->fields[$fieldName])) {
70
return ($this->fields[$fieldName]);
77
* Calls the get method for the given field name.
80
* @author Anthony Bush
82
public function getField($fieldName) {
83
$getter = 'get' . self::titleCase($fieldName);
84
return $this->$getter();
88
* Sets the current value of $fieldName to $value.
90
* @param string $fieldName
94
protected function rawSetField($fieldName, $value) {
95
$this->setModifiedField($fieldName);
96
$this->fields[$fieldName] = $value;
100
* Calls the set method for the given field name.
103
* @author Anthony Bush
105
public function setField($fieldName, $value) {
106
$setter = 'set' . self::titleCase($fieldName);
107
return $this->$setter($value);
b'\\ No newline at end of file'