/** * @param ReferenceList $model * @return array */ public function encodeReferenceList($model) { $result = array_map(function ($id) { return MongoMapper::mongoID($id->asString()); }, $model->refs); return $result; }