public function getShipments($filter = null)
    {
        if (null === $filter) {
            return $this->shipments;
        }

        return $this->shipments->filter(function(ShipmentInterface $shipment) use ($filter) {
            return $filter xor $shipment->isReturn();
        });
    }
public function getShipments($filter = null)
    {
        if (null === $filter) {
            return $this->shipments;
        }

        return $this->shipments->filter(function(ShipmentInterface $shipment) use ($filter) {
            return $filter xor $shipment->isReturn();
        });
    }
Returns the shipments.

@param bool $filter TRUE for shipments, FALSE for returns, NULL for all

@return \Doctrine\Common\Collections\Collection|ShipmentInterface[]