Permalink
Browse files

Merge branch 'master' of github.com:rezzza/SepaBundle

  • Loading branch information...
2 parents 8807522 + be983b1 commit 19fda8f1ed081dd345bdf72904455dbfa9c9c3c0 @stephpy stephpy committed Oct 1, 2012
View
@@ -4,6 +4,7 @@
use JMS\SerializerBundle\Annotation\Type;
use JMS\SerializerBundle\Annotation\SerializedName;
+use JMS\SerializerBundle\Annotation\PreSerialize;
/**
* GroupHeader
@@ -25,7 +26,7 @@ class GroupHeader
* MANDATORY
* IGNORED
*
- * @Type("datetime")
+ * @Type("string")
* @SerializedName("CreDtTm")
*/
public $creationDateTime;
@@ -62,4 +63,14 @@ class GroupHeader
* @SerializedName("InitgPty")
*/
public $initiatingParty;
+
+ /**
+ * @PreSerialize()
+ */
+ public function fixDateTime()
+ {
+ if ($this->creationDateTime instanceof \DateTime) {
+ $this->creationDateTime = $this->creationDateTime->format('Y-m-d\TH:i:s');
+ }
+ }
}
@@ -5,6 +5,7 @@
use JMS\SerializerBundle\Annotation\XmlList;
use JMS\SerializerBundle\Annotation\Type;
use JMS\SerializerBundle\Annotation\SerializedName;
+use JMS\SerializerBundle\Annotation\PreSerialize;
/**
* PaymentInformation
@@ -40,7 +41,7 @@ class PaymentInformation
/**
* MANDATORY
*
- * @Type("datetime")
+ * @Type("string")
* @SerializedName("ReqdExctnDt")
*/
public $requestedExecutionDate;
@@ -92,4 +93,15 @@ class PaymentInformation
* @Type("Rezzza\SepaBundle\Model\PaymentInformation\CreditTransferTransactionInformation")
*/
public $creditTransferTransactionInformations;
+
+ /**
+ * @PreSerialize()
+ */
+ public function fixDateTime()
+ {
+ if ($this->requestedExecutionDate instanceof \DateTime) {
+ $this->requestedExecutionDate = $this->requestedExecutionDate->format('Y-m-d');
+ }
+ }
+
}
@@ -17,7 +17,7 @@ class CreditorAgent
* MANDATORY
*
* @Type("Rezzza\SepaBundle\Model\PaymentInformation\Debtors\FinancialInstitutionIdentification")
- * @SerializedName("PmtId")
+ * @SerializedName("FinInstnId")
*/
public $financialInstitutionIdentification;

0 comments on commit 19fda8f

Please sign in to comment.