src/WooCommerce/Shop/InvoiceStatusOverviewForm.php
private function setSubmittedSource()
    {
        // Get actual source ($this->source may be the parent, not the source to
        // execute on). Do so without trusting the input.
        $sourceType = $this->getSubmittedValue('type') === Source::Order ? Source::Order : Source::CreditNote;
        $sourceId = (int) $this->getSubmittedValue('source');
        $this->submittedSource = null;
        if ($this->source->getType() === $sourceType && $this->source->getId() === $sourceId) {
            $this->submittedSource = $this->source;
        } else {
            $creditNotes = $this->source->getCreditNotes();
            foreach ($creditNotes as $creditNote) {
                if ($creditNote->getType() === $sourceType && $creditNote->getId() === $sourceId) {
                    $this->submittedSource = $creditNote;
                }
            }
        }
    }
private function setSubmittedSource()
    {
        // Get actual source ($this->source may be the parent, not the source to
        // execute on). Do so without trusting the input.
        $sourceType = $this->getSubmittedValue('type') === Source::Order ? Source::Order : Source::CreditNote;
        $sourceId = (int) $this->getSubmittedValue('source');
        $this->submittedSource = null;
        if ($this->source->getType() === $sourceType && $this->source->getId() === $sourceId) {
            $this->submittedSource = $this->source;
        } else {
            $creditNotes = $this->source->getCreditNotes();
            foreach ($creditNotes as $creditNote) {
                if ($creditNote->getType() === $sourceType && $creditNote->getId() === $sourceId) {
                    $this->submittedSource = $creditNote;
                }
            }
        }
    }
private function setSubmittedSource ( ) { // Get actual source ($this->source may be the parent, not the source to // execute on). Do so without trusting the input. $ sourceType = $ this -> getSubmittedValue ( 'type' ) === Source :: Order ? Source :: Order : Source :: CreditNote ; $ sourceId = ( int ) $ this -> getSubmittedValue ( 'source' ) ; $ this -> submittedSource = null ; if ( $ this -> source -> getType ( ) === $ sourceType && $ this -> source -> getId ( ) === $ sourceId ) { $ this -> submittedSource = $ this -> source ; } else { $ creditNotes = $ this -> source -> getCreditNotes ( ) ; foreach ( $ creditNotes as $ creditNote ) { if ( $ creditNote -> getType ( ) === $ sourceType && $ creditNote -> getId ( ) === $ sourceId ) { $ this -> submittedSource = $ creditNote ; } } } }
Extracts the source on which the submitted action is targeted.
Extracts the source on which the submitted action is targeted .