src/forms/EmployeeForm.php
protected function extractContract($contact)
    {
        foreach ($contact->documents as $document) {
            if ($document->type === 'contract') {
                $document->scenario = $this->scenario;

                return $document;
            }
        }

        return null;
    }
protected function extractContract($contact)
    {
        foreach ($contact->documents as $document) {
            if ($document->type === 'contract') {
                $document->scenario = $this->scenario;

                return $document;
            }
        }

        return null;
    }
protected function extractContract ( $ contact ) { foreach ( $ contact -> documents as $ document ) { if ( $ document -> type === 'contract' ) { $ document -> scenario = $ this -> scenario ; return $ document ; } } return null ; }
Extracts contract out of documents array.

@param Contact $contact
@return Document|null
Extracts contract out of documents array .