protected function optimizePrimaryKey()
    {
        if ($this->field->isPrimary()) {
			$this->field->isNullable = false;
				
            if ($this->meta == null) {
                $this->field->isOnFormView = false;
                $this->field->isOnIndexView = false;
                $this->field->isOnShowView = false;

                return $this;
            }

            if (!array_key_exists('is-on-views', $this->meta)) {
                if (!array_key_exists('is-on-form', $this->meta)) {
                    $this->field->isOnFormView = false;
                }

                if (!array_key_exists('is-on-index', $this->meta)) {
                    $this->field->isOnIndexView = false;
                }

                if (!array_key_exists('is-on-show', $this->meta)) {
                    $this->field->isOnShowView = false;
                }
            }
        }

        return $this;
    }
protected function optimizePrimaryKey()
    {
        if ($this->field->isPrimary()) {
			$this->field->isNullable = false;
				
            if ($this->meta == null) {
                $this->field->isOnFormView = false;
                $this->field->isOnIndexView = false;
                $this->field->isOnShowView = false;

                return $this;
            }

            if (!array_key_exists('is-on-views', $this->meta)) {
                if (!array_key_exists('is-on-form', $this->meta)) {
                    $this->field->isOnFormView = false;
                }

                if (!array_key_exists('is-on-index', $this->meta)) {
                    $this->field->isOnIndexView = false;
                }

                if (!array_key_exists('is-on-show', $this->meta)) {
                    $this->field->isOnShowView = false;
                }
            }
        }

        return $this;
    }
protected function optimizePrimaryKey ( ) { if ( $ this -> field -> isPrimary ( ) ) { $ this -> field -> isNullable = false ; if ( $ this -> meta == null ) { $ this -> field -> isOnFormView = false ; $ this -> field -> isOnIndexView = false ; $ this -> field -> isOnShowView = false ; return $ this ; } if ( ! array_key_exists ( 'is-on-views' , $ this -> meta ) ) { if ( ! array_key_exists ( 'is-on-form' , $ this -> meta ) ) { $ this -> field -> isOnFormView = false ; } if ( ! array_key_exists ( 'is-on-index' , $ this -> meta ) ) { $ this -> field -> isOnIndexView = false ; } if ( ! array_key_exists ( 'is-on-show' , $ this -> meta ) ) { $ this -> field -> isOnShowView = false ; } } } return $ this ; }
If the property name is "id" or if the field is primary or autoincrement.
Ensure, the datatype is set to be valid otherwise make it "int".
It also make sure the primary column does not appears on the views unless it specified

@param CrestApps\CodeGenerator\Models\Field $this->field

@return $this
If the property name is id or if the field is primary or autoincrement . Ensure the datatype is set to be valid otherwise make it int . It also make sure the primary column does not appears on the views unless it specified