/** * Calls the base type to read all attachments, then extracts the title of the * main attachment, if applicable. */ function convert_from_storage($source) { parent::convert_from_storage($source); if (array_key_exists('main', $this->attachments)) { $this->title = $this->attachments['main']->title; } }