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

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