protected function buildIdentificationCriteria(array $subject)
    {
        $criteria = [];

        foreach ($this->identificationFields as $dbField => $subjectField) {
            if (empty($subject[$subjectField])) {
                throw new \InvalidArgumentException(sprintf('Subject must contain a(n) "%s" field', $subjectField));
            }

            if (is_numeric($dbField)) {
                $dbField = $subjectField;
            }

            $criteria[$dbField] = $subject[$subjectField];
        }

        return $criteria;
    }
protected function buildIdentificationCriteria(array $subject)
    {
        $criteria = [];

        foreach ($this->identificationFields as $dbField => $subjectField) {
            if (empty($subject[$subjectField])) {
                throw new \InvalidArgumentException(sprintf('Subject must contain a(n) "%s" field', $subjectField));
            }

            if (is_numeric($dbField)) {
                $dbField = $subjectField;
            }

            $criteria[$dbField] = $subject[$subjectField];
        }

        return $criteria;
    }
protected function buildIdentificationCriteria ( array $ subject ) { $ criteria = [ ] ; foreach ( $ this -> identificationFields as $ dbField => $ subjectField ) { if ( empty ( $ subject [ $ subjectField ] ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Subject must contain a(n) "%s" field' , $ subjectField ) ) ; } if ( is_numeric ( $ dbField ) ) { $ dbField = $ subjectField ; } $ criteria [ $ dbField ] = $ subject [ $ subjectField ] ; } return $ criteria ; }
Checks if all identification field is included in the subject and builds a criteria

@param array $subject

@return array

@throws \InvalidArgumentException If one of the fields is missing
Checks if all identification field is included in the subject and builds a criteria