Esempio n. 1
0
 /**
  * @test
  */
 public function testToNVPString()
 {
     $this->object->line2 = '6th Avenue';
     $this->object->postalCode = '2345667';
     $this->object->state = 'California';
     $ret = $this->object->toNVPString();
     $this->assertEquals('line1=Main+St&line2=6th+Avenue&city=San+Jose&state=California&postalCode=2345667&countryCode=US', $ret);
 }
Esempio n. 2
0
 /**
  * Address constructor.
  *
  * @param $firstname
  * @param $lastname
  * @param $address1
  * @param $postalCode
  * @param $city
  * @param $countryCode
  * @param null $companyName
  * @param null $address2
  * @param null $cOAddress
  * @param null $phoneNumber
  * @param null $cellPhoneNumber
  * @param null $email
  */
 public function __construct($firstname, $lastname, $address1, $postalCode, $city, $countryCode, $companyName = null, $address2 = null, $cOAddress = null, $phoneNumber = null, $cellPhoneNumber = null, $email = null)
 {
     parent::__construct($address1, $address2, $cOAddress, $postalCode, $city, $countryCode);
     $this->Firstname = $firstname;
     $this->Lastname = $lastname;
     $this->Companyname = $companyName;
     $this->PhoneNumber = $phoneNumber;
     $this->CellPhoneNumber = $cellPhoneNumber;
     $this->Email = $email;
 }
Esempio n. 3
0
 public function init($map = null, $prefix = '')
 {
     if ($map != null) {
         $mapKeyName = $prefix . 'addresseeName';
         if ($map != null && array_key_exists($mapKeyName, $map)) {
             $this->addresseeName = $map[$mapKeyName];
         }
         if (PPUtils::array_match_key($map, $prefix . "baseAddress.")) {
             $newPrefix = $prefix . "baseAddress.";
             $this->baseAddress = new BaseAddress();
             $this->baseAddress->init($map, $newPrefix);
         }
         $mapKeyName = $prefix . 'addressId';
         if ($map != null && array_key_exists($mapKeyName, $map)) {
             $this->addressId = $map[$mapKeyName];
         }
     }
 }
Esempio n. 4
0
 /**
  * Returns a peer instance associated with this om.
  *
  * Since Peer classes are not to have any instance attributes, this method returns the
  * same instance for all member of this class. The method could therefore
  * be static, but this would prevent one from overriding the behavior.
  *
  * @return AddressPeer
  */
 public function getPeer()
 {
     if (self::$peer === null) {
         self::$peer = new AddressPeer();
     }
     return self::$peer;
 }
Esempio n. 5
0
 public function init($map = null, $prefix = '')
 {
     if ($map != null) {
         $mapKeyName = $prefix . 'firstName';
         if ($map != null && array_key_exists($mapKeyName, $map)) {
             $this->firstName = $map[$mapKeyName];
         }
         $mapKeyName = $prefix . 'lastName';
         if ($map != null && array_key_exists($mapKeyName, $map)) {
             $this->lastName = $map[$mapKeyName];
         }
         $mapKeyName = $prefix . 'businessName';
         if ($map != null && array_key_exists($mapKeyName, $map)) {
             $this->businessName = $map[$mapKeyName];
         }
         $mapKeyName = $prefix . 'phone';
         if ($map != null && array_key_exists($mapKeyName, $map)) {
             $this->phone = $map[$mapKeyName];
         }
         $mapKeyName = $prefix . 'fax';
         if ($map != null && array_key_exists($mapKeyName, $map)) {
             $this->fax = $map[$mapKeyName];
         }
         $mapKeyName = $prefix . 'website';
         if ($map != null && array_key_exists($mapKeyName, $map)) {
             $this->website = $map[$mapKeyName];
         }
         $mapKeyName = $prefix . 'customValue';
         if ($map != null && array_key_exists($mapKeyName, $map)) {
             $this->customValue = $map[$mapKeyName];
         }
         if (PPUtils::array_match_key($map, $prefix . "address.")) {
             $newPrefix = $prefix . "address.";
             $this->address = new BaseAddress();
             $this->address->init($map, $newPrefix);
         }
     }
 }
Esempio n. 6
0
 public static function model($className = __CLASS__)
 {
     return parent::model($className);
 }
Esempio n. 7
0
 public function rules()
 {
     return array_merge(parent::rules());
 }