public function convertToPHPValue($value, $type) { if ($type == 'date') { return \Maestro\Manager::Date($value); } elseif ($type == 'timestamp') { return \Maestro\Manager::Timestamp($value); } elseif ($type == 'currency') { return \Maestro\Manager::currency($value); } elseif ($type == 'cnpj') { return \Maestro\Types\MCNPJ::create($value); } elseif ($type == 'cpf') { return \Maestro\Types\MCPF::create($value); } elseif ($type == 'currency') { return \Maestro\Manager::currency($value); } elseif ($type == 'boolean') { return !empty($value); } elseif ($type == 'blob') { $value = \Maestro\Types\MFile::file(base64_decode($value)); return $value; } else { return $value; } }