Get the field value from an appointment object

@param \Gems_Agenda_Appointment $appointment
@param string $field
@return mixed
329441
public function getAppointmentFieldValue(\Gems_Agenda_Appointment $appointment, $field)
    {
        switch ($field) {
            case 'gap_id_organization':
                return $appointment->getOrganizationId();

            case 'gap_source':
                return $appointment->getSource();

            case 'gap_id_attended_by':
                return $appointment->getAttendedById();

            case 'gap_id_referred_by':
                return $appointment->getReferredById();

            case 'gap_id_activity':
                return $appointment->getActivityId();

            case 'gap_id_procedure':
                return $appointment->getProcedureId();

            case 'gap_id_location':
                return $appointment->getLocationId();

            case 'gap_subject':
                return $appointment->getSubject();
        }
    }
529638
public function getFieldValue(object $document, string $field)
    {
        if ($document instanceof GhostObjectInterface && $field !== $this->identifier && ! $document->isProxyInitialized()) {
            $document->initializeProxy();
        }

        return $this->reflFields[$field]->getValue($document);
    }
429153
public function getField($field)
    {
        return isset($this->data[$field])
            ? $this->data[$field]
            : $this->searchField($field);
    }
1080198
public function getFieldByOrder($order)
    {
        foreach ($this->_fields as $field) {
            if ($field instanceof FieldInterface) {
                if ($field->getOrder() == $order) {
                    return $field;
                }
            }
        }

        return null;
    }
899535
public function get($field)
    {
        if (!is_null($this->filtered) && ! is_null($this->filtered[0])) {
            return isset($this->filtered[0][0][$field]) ? $this->filtered[0][0][$field] : null;
        }

        // Todo: Get values of entities
    }
1143073
public function getFieldValue($field, $data = null)
    {
        if ($data !== null && isset($data[$field])) {
            return $data[$field];
        }
        if (isset($this->{$field})) {
            return $this->{$field};
        }
        return null;
    }
575476
def appointment(self):
        
        return django_apps.get_model(self.appointment_model).objects.get(
            pk=self.request.GET.get("appointment")
        )
901839
public function getField($field)
    {
        $fields = $this->getFields();
        if (!isset($fields[$field])) {
            throw new \LogicException(sprintf('Undefined field %s.', $field));
        }

        return $fields[$field];
    }
560436
public function getFieldValue($document, $field)
    {
        if ($document instanceof Proxy && $field !== $this->identifier && ! $document->__isInitialized()) {
            $document->__load();
        }

        return $this->reflFields[$field]->getValue($document);
    }
779234
public static int getBeginValue(Calendar calendar, int dateField) {
		if(Calendar.DAY_OF_WEEK == dateField) {
			return calendar.getFirstDayOfWeek();
		}
		return calendar.getActualMinimum(dateField);
	}
1019538
private function getMaterialField($field)
    {
        if (isset($this->fields[$field['name']]) && is_object($this->fields[$field['name']]))
            return $this->fields[$field['name']];
            
        $slot = new Cache\Slot\MaterialField($this->table, $this->fields['id'], $field['name']);
        if (!$this->fields['id'] || false === ($_tmp = $slot->load())) {        
    
            if (!isset($this->fields[$field['name']]))
                $this->fields[$field['name']] = $this->getPlainField($field);

            if ($this->fields[$field['name']]) {
				
				try {
				
					if ($field['pseudo_type'] == PSEUDO_FIELD_LINK_CATALOG) {
						 $this->fields[$field['name']] = Catalog::getById($this->fields[$field['name']]);
					}
					elseif ($field['pseudo_type'] == PSEUDO_FIELD_LINK_USER) {   
						   $this->fields[$field['name']] = User::getById($this->fields[$field['name']]);  
					} 
					else {
									
						if ($field['type'] == FIELD_LINK) {
							if ($field['len']) {
								$c = Catalog::getById($field['len']);
								if (!$c) throw new Exception\CMS('Catalog '.$field['len'].' is not found.');
								$type = $c->materialsType;
							} else $type = $this->objectDefinition->id;
						} else {
							$type = $field['len'];
						}
						
						$this->fields[$field['name']] = self::getByIdType( $this->fields[$field['name']], $type );
					
					}
					
				}
				catch (\Exception $e) {
					$this->fields[$field['name']] = null;
				}
            
            } else {
                
                $this->fields[$field['name']] = null;
                
            }
            
            $slot->addTag(new Cache\Tag\Material($this->table, $this->fields['id']));
            $slot->save($this->fields[$field['name']]);
        } else {
            $this->fields[$field['name']] = $_tmp;
        }
        
        return $this->fields[$field['name']];
    }
124022
public function showAppointment($value)
    {
        if (! $value) {
            return $this->_('Unknown');
        }
        if ($value instanceof \Gems_Agenda_Appointment) {
            $appointment = $value;
        } else {
            $appointment = $this->loader->getAgenda()->getAppointment($value);
        }
        if ($appointment instanceof \Gems_Agenda_Appointment) {
            if (! $this->menu instanceof \Gems_Menu) {
                $this->menu = $this->loader->getMenu();
            }
            $menuItem = $this->menu->findAllowedController('appointment', 'show');
            if ($menuItem) {
                if (! $this->request) {
                    $this->request = \Zend_Controller_Front::getInstance()->getRequest();
                }
                $href = $menuItem->toHRefAttribute(
                        array('gap_id_appointment' => $appointment->getId()),
                        $this->request
                        );
                if ($href) {
                    return \MUtil_Html::create('a', $href, $appointment->getDisplayString());
                }
            }
            return $appointment->getDisplayString();
        }

        return $value;
    }
472686
final public function getRowFieldValue($field)
    {

        //If value exists;
        if (array_key_exists($field, $this->schema)) {
            return $this->schema[$field]->Value;
        }
        return null;
    }
618821
public function getField($field, $language = null)
    {
        $language = $language ?: $this->language;

        return $this->getTree()->getField($this, $field, $language);
    }
1129527
public function date($field, $format)
    {
        $fieldValue = $this->get($field);

        try {

            $date = new \DateTime($fieldValue);

            return $fieldValue === $date->format($format);
        } catch (\Exception $exception) {
            return $this->error($field, __FUNCTION__);
        }
    }
1172328
public static function fetchOneValue(string $field, $where = null, $orderField = null, $orderDirection = null)
    {
        $select = static::select()->field($field, 'key_field')->limit(0, 1);

        if ($where !== null) {
            if ($where instanceof Where) {
                $select->where($where);
            } else if (is_array($where)) {
                foreach ($where as $field => $value) {
                    $select->where($field, $value);
                }
            } else if (!is_array(static::$primaryKey) && (is_numeric($where) || is_string($where))) {
                $select->where(static::$primaryKey, $where);
            }
        }

        if ($orderField !== null) {
            $select->orderBy($orderField, $orderDirection);
        }

        $records = $select->fetchAll();
        if (count($records) == 0) {
            return null;
        }

        return $records[0]['key_field'];
    }
1267416
public function getEntityAttributeValue($field)
    {
        if ($field) {
            $functionName = 'get'.ucfirst($field);

            // Avoid error when the widget refer to a property that has been removed
            if (!method_exists($this, $functionName)) {
                return;
            }

            $fieldValue = $this->{$functionName}();
        } else {
            $fieldValue = null;
        }

        return $fieldValue;
    }