Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?PHP
2
/**
3
 * Model for a shipment
4
 *
5
 *
6
 * @package Services_Ebay
7
 * @author  Stephan Schmidt <schst@php.net>
8
 */
9
class Services_Ebay_Model_Shipment extends Services_Ebay_Model
10
{
11
   /**
12
    * default properties for a shipment
13
    *
14
    * @var  array
15
    */
16
    protected $properties = array(
17
                                    'CurrencyId'   => 1,
18
                                    'Transactions' => array()
19
                                );
20
 
21
   /**
22
    * set package dimemsions for the shipment
23
    *
24
    * @param    int     depth
25
    * @param    int     length
26
    * @param    int     width
27
    * @return   void
28
    */
29
    public function SetPackageDimensions($Depth, $Length, $Width)
30
    {
31
        $this->properties['PackageDimensions'] = array(
32
                                                        'Depth'         => $Depth,
33
                                                        'Length'        => $Length,
34
                                                        'Width'         => $Width,
35
                                                        'UnitOfMeasure' => 1
36
                                                    );
37
    }
38
 
39
   /**
40
    * add a transaction
41
    *
42
    * @param    string  item id
43
    * @param    string  transactio id
44
    * @return   void
45
    */
46
    public function AddTransaction($ItemId, $TransactionId)
47
    {
48
        array_push($this->properties['Transactions'], array( 'ItemId' => $ItemId, 'TransactionId' => $TransactionId ));
49
    }
50
 
51
   /**
52
    * set the from address
53
    *
54
    * @param    string  company name
55
    * @param    string  name
56
    * @param    string  street, line 1
57
    * @param    string  street, line 2
58
    * @param    string  city
59
    * @param    string  zipcode
60
    * @param    string  state or province
61
    * @param    string  country
62
    * @param    string  phone number
63
    * @return   void
64
    */
65
    public function SetFromAddress($CompanyName, $Name, $Street1, $Street2, $City, $Zip, $StateOrProvince, $Country, $Phone = null)
66
    {
67
        $this->properties['ShipFromAddress'] = array(
68
                                                        'CompanyName'     => $CompanyName,
69
                                                        'Name'            => $Name,
70
                                                        'Street1'         => $Street1,
71
                                                        'Street2'         => $Street2,
72
                                                        'City'            => $City,
73
                                                        'Zip'             => $Zip,
74
                                                        'StateOrProvince' => $StateOrProvince,
75
                                                        'Country'         => $Country,
76
                                                        'Phone'           => $Phone
77
                                                    );
78
    }
79
 
80
   /**
81
    * set the to address
82
    *
83
    * @param    string  type of the address
84
    * @param    string  company name
85
    * @param    string  name
86
    * @param    string  street, line 1
87
    * @param    string  street, line 2
88
    * @param    string  city
89
    * @param    string  zipcode
90
    * @param    string  state or province
91
    * @param    string  country
92
    * @param    string  phone number
93
    * @return   void
94
    */
95
    public function SetAddress($Type, $CompanyName, $Name, $Street1, $Street2, $City, $Zip, $StateOrProvince, $Country, $Phone = null)
96
    {
97
        $this->properties['ShippingAddress'] = array(
98
                                                        'AddressType'     => $Type,
99
                                                        'CompanyName'     => $CompanyName,
100
                                                        'Name'            => $Name,
101
                                                        'Street1'         => $Street1,
102
                                                        'Street2'         => $Street2,
103
                                                        'City'            => $City,
104
                                                        'Zip'             => $Zip,
105
                                                        'StateOrProvince' => $StateOrProvince,
106
                                                        'Country'         => $Country,
107
                                                        'Phone'           => $Phone
108
                                                    );
109
    }
110
}
111
?>