Entity/BaseOrder.php
public function containsOnlyOneType($type = null)
    {
        $wType = false;
        $sameType = true;
        foreach ($this->getOrderElements() as $orderElement) {
            $xType = $orderElement->getProduct()->getValidatedAt();
            if (!$wType) {
                $wType = $xType;
            } elseif ($xType !== $wType) {
                $sameType = false;
            }
        }
        if ($sameType) {
            if (is_numeric($type)) {
                return $type === $wType;
            }

            return true;
        }

        return false;
    }
public function containsOnlyOneType($type = null)
    {
        $wType = false;
        $sameType = true;
        foreach ($this->getOrderElements() as $orderElement) {
            $xType = $orderElement->getProduct()->getValidatedAt();
            if (!$wType) {
                $wType = $xType;
            } elseif ($xType !== $wType) {
                $sameType = false;
            }
        }
        if ($sameType) {
            if (is_numeric($type)) {
                return $type === $wType;
            }

            return true;
        }

        return false;
    }
@param null $type

@return bool