CommonITILObject::getCalendar PHP Метод

getCalendar() публичный Метод

Get correct Calendar: Entity or Sla
С версии: 0.90.4
public getCalendar ( )
    function getCalendar()
    {
        return Entity::getUsedConfig('calendars_id', $this->fields['entities_id']);
    }

Usage Example

Пример #1
0
 /**
  * Get correct Calendar: Entity or Sla
  *
  * @since 0.90.4
  *
  **/
 function getCalendar()
 {
     if (isset($this->fields['slts_ttr_id']) && $this->fields['slts_ttr_id'] > 0) {
         $sla = new SLA();
         if ($sla->getFromDB($this->fields['slts_ttr_id'])) {
             // not -1: calendar of the entity
             if ($sla->getField('calendars_id') >= 0) {
                 return $sla->getField('calendars_id');
             }
         }
     }
     return parent::getCalendar();
 }
CommonITILObject