private function checkRequiredData($data, $isNew)
    {
        // Either name or products must be set.
        if (array_key_exists('product', $data)) {
            // Product-id must be defined.
            $this->getProductId($data['product'], 'product.id');
        } else {
            $this->checkDataSet($data, 'name', $isNew);
            $this->checkDataSet($data, 'quantityUnit', $isNew);
        }
        $this->checkDataSet($data, 'quantity', $isNew);
    }
private function checkRequiredData($data, $isNew)
    {
        // Either name or products must be set.
        if (array_key_exists('product', $data)) {
            // Product-id must be defined.
            $this->getProductId($data['product'], 'product.id');
        } else {
            $this->checkDataSet($data, 'name', $isNew);
            $this->checkDataSet($data, 'quantityUnit', $isNew);
        }
        $this->checkDataSet($data, 'quantity', $isNew);
    }
private function checkRequiredData ( $ data , $ isNew ) { // Either name or products must be set. if ( array_key_exists ( 'product' , $ data ) ) { // Product-id must be defined. $ this -> getProductId ( $ data [ 'product' ] , 'product.id' ) ; } else { $ this -> checkDataSet ( $ data , 'name' , $ isNew ) ; $ this -> checkDataSet ( $ data , 'quantityUnit' , $ isNew ) ; } $ this -> checkDataSet ( $ data , 'quantity' , $ isNew ) ; }
Check if necessary data is set.

@param array $data
@param bool $isNew

@throws MissingItemAttributeException
Check if necessary data is set .