fix(db): Rewrite method to convert postgresql arrays (closes #4739)

extract method Doc::pgArray* from Doc class and move to a new class Dcp\Utils\PgArray