protected function createTaxRateAmountFromDefinition(array $definition)
    {
        $amount = new TaxRateAmount();
        $setValues = \Closure::bind(function ($definition) {
            $this->id = $definition['id'];
            $this->amount = $definition['amount'];
            if (isset($definition['start_date'])) {
                $this->startDate = new \DateTime($definition['start_date']);
            }
            if (isset($definition['end_date'])) {
                $this->endDate = new \DateTime($definition['end_date']);
            }
        }, $amount, '\CommerceGuys\Tax\Model\TaxRateAmount');
        $setValues($definition);

        return $amount;
    }
protected function createTaxRateAmountFromDefinition(array $definition)
    {
        $amount = new TaxRateAmount();
        $setValues = \Closure::bind(function ($definition) {
            $this->id = $definition['id'];
            $this->amount = $definition['amount'];
            if (isset($definition['start_date'])) {
                $this->startDate = new \DateTime($definition['start_date']);
            }
            if (isset($definition['end_date'])) {
                $this->endDate = new \DateTime($definition['end_date']);
            }
        }, $amount, '\CommerceGuys\Tax\Model\TaxRateAmount');
        $setValues($definition);

        return $amount;
    }
protected function createTaxRateAmountFromDefinition ( array $ definition ) { $ amount = new TaxRateAmount ( ) ; $ setValues = \ Closure :: bind ( function ( $ definition ) { $ this -> id = $ definition [ 'id' ] ; $ this -> amount = $ definition [ 'amount' ] ; if ( isset ( $ definition [ 'start_date' ] ) ) { $ this -> startDate = new \ DateTime ( $ definition [ 'start_date' ] ) ; } if ( isset ( $ definition [ 'end_date' ] ) ) { $ this -> endDate = new \ DateTime ( $ definition [ 'end_date' ] ) ; } } , $ amount , '\CommerceGuys\Tax\Model\TaxRateAmount' ) ; $ setValues ( $ definition ) ; return $ amount ; }
Creates a tax rate amount object from the provided definition.

@param array $definition The tax rate amount definition.

@return TaxRateAmount
Creates a tax rate amount object from the provided definition .