• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

aimeos / aimeos-core / 19bfd2c9-77c1-48e1-a822-6de0edf8768c

11 Aug 2024 11:54AM UTC coverage: 91.806% (+0.004%) from 91.802%
19bfd2c9-77c1-48e1-a822-6de0edf8768c

push

circleci

aimeos
Simplified order coupon manager

13 of 13 new or added lines in 1 file covered. (100.0%)

25 existing lines in 5 files now uncovered.

10453 of 11386 relevant lines covered (91.81%)

59.5 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.12
/src/MShop/Order/Item/Address/Standard.php
1
<?php
2

3
/**
4
 * @license LGPLv3, https://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2015-2024
6
 * @package MShop
7
 * @subpackage Order
8
 */
9

10

11
namespace Aimeos\MShop\Order\Item\Address;
12

13

14
/**
15
 * Default order address container object
16
 *
17
 * @package MShop
18
 * @subpackage Order
19
 */
20
class Standard
21
        extends \Aimeos\MShop\Order\Item\Address\Base
22
        implements \Aimeos\MShop\Order\Item\Address\Iface
23
{
24
        /**
25
         * Returns the original customer address ID.
26
         *
27
         * @return string Customer address ID
28
         */
29
        public function getAddressId() : string
30
        {
31
                return $this->get( 'order.address.addressid', '' );
16✔
32
        }
33

34

35
        /**
36
         * Sets the original customer address ID.
37
         *
38
         * @param string $addrid New customer address ID
39
         * @return \Aimeos\MShop\Order\Item\Address\Iface Order base address item for chaining method calls
40
         */
41
        public function setAddressId( string $addrid ) : \Aimeos\MShop\Order\Item\Address\Iface
42
        {
43
                return $this->set( 'order.address.addressid', $addrid );
4✔
44
        }
45

46

47
        /**
48
         * Copys all data from a given address item.
49
         *
50
         * @param \Aimeos\MShop\Common\Item\Address\Iface $item New address
51
         * @return \Aimeos\MShop\Order\Item\Address\Iface Order base address item for chaining method calls
52
         */
53
        public function copyFrom( \Aimeos\MShop\Common\Item\Address\Iface $item ) : \Aimeos\MShop\Common\Item\Address\Iface
54
        {
55
                if( self::macro( 'copyFrom' ) ) {
2✔
UNCOV
56
                        return $this->call( 'copyFrom', $item );
×
57
                }
58

59
                parent::copyFrom( $item );
2✔
60

61
                $this->setAddressId( (string) $item->getId() );
2✔
62
                $this->setModified();
2✔
63

64
                return $this;
2✔
65
        }
66

67

68
        /*
69
         * Sets the item values from the given array and removes that entries from the list
70
         *
71
         * @param array &$list Associative list of item keys and their values
72
         * @param bool True to set private properties too, false for public only
73
         * @return \Aimeos\MShop\Order\Item\Address\Iface Order address item for chaining method calls
74
         */
75
        public function fromArray( array &$list, bool $private = false ) : \Aimeos\MShop\Common\Item\Iface
76
        {
77
                $item = parent::fromArray( $list, $private );
3✔
78

79
                foreach( $list as $key => $value )
3✔
80
                {
81
                        switch( $key )
82
                        {
83
                                case 'order.address.addressid': $item = $item->setAddressId( $value ); break;
3✔
84
                                default: continue 2;
2✔
85
                        }
86

87
                        unset( $list[$key] );
2✔
88
                }
89

90
                return $item;
3✔
91
        }
92

93

94
        /**
95
         * Returns the item values as array.
96
         *
97
         * @param bool True to return private properties, false for public only
98
         * @return array Associative list of item properties and their values
99
         */
100
        public function toArray( bool $private = false ) : array
101
        {
102
                $list = parent::toArray( $private );
13✔
103

104
                $list['order.address.addressid'] = $this->getAddressId();
13✔
105

106
                return $list;
13✔
107
        }
108

109
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc