protected function getPrimaryField(array $fields)
    {
        foreach ($fields as $field) {
            if ($this->isField($field) && ($field->isPrimary || $field->isAutoIncrement)) {
                return $field;
            }
        }

        return null;
    }
protected function getPrimaryField(array $fields)
    {
        foreach ($fields as $field) {
            if ($this->isField($field) && ($field->isPrimary || $field->isAutoIncrement)) {
                return $field;
            }
        }

        return null;
    }
protected function getPrimaryField ( array $ fields ) { foreach ( $ fields as $ field ) { if ( $ this -> isField ( $ field ) && ( $ field -> isPrimary || $ field -> isAutoIncrement ) ) { return $ field ; } } return null ; }
Determine the primary field in a given array

@param array $fields

@return CrestApps\CodeGenerator\Models\Field
Determine the primary field in a given array