PHP Class DVDoug\BoxPacker\Packer

Author: Doug Wright
Inheritance: implements Psr\Log\LoggerAwareInterface, use trait Psr\Log\LoggerAwareTrait
Afficher le fichier Open project: dvdoug/boxpacker Class Usage Examples

Protected Properties

Свойство Type Description
$boxes DVDoug\BoxPacker\BoxList List of box sizes available to pack items into
$items ItemList List of items to be packed

Méthodes publiques

Méthode Description
__construct ( ) Constructor
addBox ( DVDoug\BoxPacker\Box $box ) Add box size
addItem ( DVDoug\BoxPacker\Item $item, integer $qty = 1 ) Add item to be packed
doVolumePacking ( ) : DVDoug\BoxPacker\PackedBoxList Pack items into boxes using the principle of largest volume item first
pack ( ) : DVDoug\BoxPacker\PackedBoxList Pack items into boxes
setBoxes ( DVDoug\BoxPacker\BoxList $boxList ) Add a pre-prepared set of boxes all at once
setItems ( Traversable | array $items ) Set a list of items all at once

Method Details

__construct() public méthode

Constructor
public __construct ( )

addBox() public méthode

Add box size
public addBox ( DVDoug\BoxPacker\Box $box )
$box DVDoug\BoxPacker\Box

addItem() public méthode

Add item to be packed
public addItem ( DVDoug\BoxPacker\Item $item, integer $qty = 1 )
$item DVDoug\BoxPacker\Item
$qty integer

doVolumePacking() public méthode

Pack items into boxes using the principle of largest volume item first
public doVolumePacking ( ) : DVDoug\BoxPacker\PackedBoxList
Résultat DVDoug\BoxPacker\PackedBoxList

pack() public méthode

Pack items into boxes
public pack ( ) : DVDoug\BoxPacker\PackedBoxList
Résultat DVDoug\BoxPacker\PackedBoxList

setBoxes() public méthode

Add a pre-prepared set of boxes all at once
public setBoxes ( DVDoug\BoxPacker\BoxList $boxList )
$boxList DVDoug\BoxPacker\BoxList

setItems() public méthode

Set a list of items all at once
public setItems ( Traversable | array $items )
$items Traversable | array

Property Details

$boxes protected_oe property

List of box sizes available to pack items into
protected BoxList,DVDoug\BoxPacker $boxes
Résultat DVDoug\BoxPacker\BoxList

$items protected_oe property

List of items to be packed
protected ItemList,DVDoug\BoxPacker $items
Résultat ItemList