function getMetric() { if (!$this->metric) { $this->metric = Entity\ScalingMetric::findPk($this->metricId); } return $this->metric; }