public function init($map = null, $prefix = '') { if ($map != null) { $mapKeyName = $prefix . 'amount'; if ($map != null && array_key_exists($mapKeyName, $map)) { $this->amount = $map[$mapKeyName]; } $mapKeyName = $prefix . 'email'; if ($map != null && array_key_exists($mapKeyName, $map)) { $this->email = $map[$mapKeyName]; } if (PPUtils::array_match_key($map, $prefix . "phone.")) { $newPrefix = $prefix . "phone."; $this->phone = new PhoneNumberType(); $this->phone->init($map, $newPrefix); } $mapKeyName = $prefix . 'primary'; if ($map != null && array_key_exists($mapKeyName, $map)) { $this->primary = $map[$mapKeyName]; } $mapKeyName = $prefix . 'invoiceId'; if ($map != null && array_key_exists($mapKeyName, $map)) { $this->invoiceId = $map[$mapKeyName]; } $mapKeyName = $prefix . 'paymentType'; if ($map != null && array_key_exists($mapKeyName, $map)) { $this->paymentType = $map[$mapKeyName]; } $mapKeyName = $prefix . 'paymentSubType'; if ($map != null && array_key_exists($mapKeyName, $map)) { $this->paymentSubType = $map[$mapKeyName]; } } }
public function toXMLString() { $str = ''; if ($this->BuyerPhone != null) { $str .= '<ebl:BuyerPhone>'; $str .= $this->BuyerPhone->toXMLString(); $str .= '</ebl:BuyerPhone>'; } if ($this->ItemAmount != null) { $str .= '<ebl:ItemAmount'; $str .= $this->ItemAmount->toXMLString(); $str .= '</ebl:ItemAmount>'; } if ($this->Tax != null) { $str .= '<ebl:Tax'; $str .= $this->Tax->toXMLString(); $str .= '</ebl:Tax>'; } if ($this->Shipping != null) { $str .= '<ebl:Shipping'; $str .= $this->Shipping->toXMLString(); $str .= '</ebl:Shipping>'; } if ($this->ItemName != null) { $str .= '<ebl:ItemName>' . PPUtils::escapeInvalidXmlCharsRegex($this->ItemName) . '</ebl:ItemName>'; } if ($this->ItemNumber != null) { $str .= '<ebl:ItemNumber>' . PPUtils::escapeInvalidXmlCharsRegex($this->ItemNumber) . '</ebl:ItemNumber>'; } if ($this->Custom != null) { $str .= '<ebl:Custom>' . PPUtils::escapeInvalidXmlCharsRegex($this->Custom) . '</ebl:Custom>'; } if ($this->InvoiceID != null) { $str .= '<ebl:InvoiceID>' . PPUtils::escapeInvalidXmlCharsRegex($this->InvoiceID) . '</ebl:InvoiceID>'; } if ($this->ReturnURL != null) { $str .= '<ebl:ReturnURL>' . PPUtils::escapeInvalidXmlCharsRegex($this->ReturnURL) . '</ebl:ReturnURL>'; } if ($this->CancelURL != null) { $str .= '<ebl:CancelURL>' . PPUtils::escapeInvalidXmlCharsRegex($this->CancelURL) . '</ebl:CancelURL>'; } if ($this->AddressDisplayOptions != null) { $str .= '<ebl:AddressDisplayOptions>' . PPUtils::escapeInvalidXmlCharsRegex($this->AddressDisplayOptions) . '</ebl:AddressDisplayOptions>'; } if ($this->SharePhone != null) { $str .= '<ebl:SharePhone>' . PPUtils::escapeInvalidXmlCharsRegex($this->SharePhone) . '</ebl:SharePhone>'; } if ($this->ShipToAddress != null) { $str .= '<ebl:ShipToAddress>'; $str .= $this->ShipToAddress->toXMLString(); $str .= '</ebl:ShipToAddress>'; } if ($this->BuyerEmail != null) { $str .= '<ebl:BuyerEmail>' . PPUtils::escapeInvalidXmlCharsRegex($this->BuyerEmail) . '</ebl:BuyerEmail>'; } return $str; }
/** * Run the database seeds. * * @return void */ public function run() { PhoneNumberType::create(['name' => 'home']); PhoneNumberType::create(['name' => 'office']); PhoneNumberType::create(['name' => 'mobile']); }
public function toXMLString() { $str = ''; if ($this->BuyerPhone != null) { //prop is not a collection //prop is complex //prop is not enum //does not contain attribute or is attribute $str .= '<ebl:BuyerPhone>'; $str .= $this->BuyerPhone->toXMLString(); $str .= '</ebl:BuyerPhone>'; } if ($this->ItemAmount != null) { //prop is not a collection //prop is complex //prop is not enum //prop containsattribute $str .= '<ebl:ItemAmount'; $str .= $this->ItemAmount->toXMLString(); $str .= '</ebl:ItemAmount>'; } if ($this->Tax != null) { //prop is not a collection //prop is complex //prop is not enum //prop containsattribute $str .= '<ebl:Tax'; $str .= $this->Tax->toXMLString(); $str .= '</ebl:Tax>'; } if ($this->Shipping != null) { //prop is not a collection //prop is complex //prop is not enum //prop containsattribute $str .= '<ebl:Shipping'; $str .= $this->Shipping->toXMLString(); $str .= '</ebl:Shipping>'; } if ($this->ItemName != null) { //prop is not a collection //prop not complex //prop is not value $str .= '<ebl:ItemName>' . $this->ItemName . '</ebl:ItemName>'; } if ($this->ItemNumber != null) { //prop is not a collection //prop not complex //prop is not value $str .= '<ebl:ItemNumber>' . $this->ItemNumber . '</ebl:ItemNumber>'; } if ($this->Custom != null) { //prop is not a collection //prop not complex //prop is not value $str .= '<ebl:Custom>' . $this->Custom . '</ebl:Custom>'; } if ($this->InvoiceID != null) { //prop is not a collection //prop not complex //prop is not value $str .= '<ebl:InvoiceID>' . $this->InvoiceID . '</ebl:InvoiceID>'; } if ($this->ReturnURL != null) { //prop is not a collection //prop not complex //prop is not value $str .= '<ebl:ReturnURL>' . $this->ReturnURL . '</ebl:ReturnURL>'; } if ($this->CancelURL != null) { //prop is not a collection //prop not complex //prop is not value $str .= '<ebl:CancelURL>' . $this->CancelURL . '</ebl:CancelURL>'; } if ($this->AddressDisplayOptions != null) { //prop is not a collection //prop not complex //prop is not value $str .= '<ebl:AddressDisplayOptions>' . $this->AddressDisplayOptions . '</ebl:AddressDisplayOptions>'; } if ($this->SharePhone != null) { //prop is not a collection //prop not complex //prop is not value $str .= '<ebl:SharePhone>' . $this->SharePhone . '</ebl:SharePhone>'; } if ($this->ShipToAddress != null) { //prop is not a collection //prop is complex //prop is not enum //does not contain attribute or is attribute $str .= '<ebl:ShipToAddress>'; $str .= $this->ShipToAddress->toXMLString(); $str .= '</ebl:ShipToAddress>'; } if ($this->BuyerEmail != null) { //prop is not a collection //prop not complex //prop is not value $str .= '<ebl:BuyerEmail>' . $this->BuyerEmail . '</ebl:BuyerEmail>'; } return $str; }
private function buildPhoneNumber( PhoneNumberType $phoneNumber , AbstractPayPalMessageFactory $factory ) { $phoneElement = $factory->createMessageElement(); $phoneElement->addChild( $factory->createMessageField( 'countryCode' , $phoneNumber->getCountryCode() ) ); $phoneElement->addChild( $factory->createMessageField( 'phoneNumber' , $phoneNumber->getPhoneNumber() ) ); if ( ( $phoneExtension = $phoneNumber->getExtension() ) != null ) { $phoneElement->addChild( $factory->createMessageField( 'extension' , $phoneExtension ) ); } return $phoneElement; }