/** * Convert the object to an array. * * @return array */ public function getArrayCopy() { $arrayCopy = get_object_vars($this); $arrayCopy[static::TEMPLATE] = $this->template ? $this->template->getId() : null; return $arrayCopy; }