/** * @return array */ public function toArray() { $payment = array_filter(get_object_vars($this)); if ($this->mandate instanceof Mandate) { unset($payment['mandate']); $payment['links']['mandate'] = $this->mandate->getId(); } return $payment; }
/** * Returns the entity as an array (as the API expects) * * @return array */ public function toArray() { $redirectFlow = array_filter(get_object_vars($this)); if ($this->creditor instanceof Creditor) { unset($redirectFlow['creditor']); $redirectFlow['links']['creditor'] = $this->creditor->getId(); } if ($this->mandate instanceof Mandate) { unset($redirectFlow['mandate']); $redirectFlow['links']['mandate'] = $this->mandate->getId(); } return $redirectFlow; }
/** @depends test_it_can_create_a_mandate */ function test_it_can_get_a_single_mandate(Mandate $old) { $new = $this->api->getMandate($old->getId()); $this->assertEquals($old->toArray(), $new->toArray()); }