public function getSetter()
    {
        $varname = '$' . $this->getPropertyName();
        $autoinc = '';
        $cast    = $this->getType()->getCastMethod() . ' ';

        if ($this->isNullable()) {
            $forceCast = $varname . ' = (' . $varname . ' === null ? ' . $varname . ' : ' . $cast . $varname . ');';
        } else {
            $forceCast = $varname . ' = ' . $cast . $varname . ';';
        }

        list($forceCheck, $exception) = $this->getCheck();

        //~ Prepend with overridden method setAutoIncrementId() for Observer/Subject when we insert new data.
        if ($this->isAutoIncrement()) {
            $autoinc = '
    /**
     * Overridden method setAutoIncrementId().
     *
     * @param  ' . $this->getType()->getType() . ' ' . $varname . '
     * @return self
     */
    public function setAutoIncrementId(' . $varname . ')
    {
        return $this->' . $this->getMethodNameSet() . '(' . $varname . ');
    }';
        }

        return $autoinc . '
    /**
     * Set value for field "' . $this->getName() . '"
     *
     * @param  ' . $this->getType()->getType() . ' ' . $varname . '
     * @return self' . (!empty($exception) ? "\n     * @throws " . $exception : '') . '
     */
    public function ' . $this->getMethodNameSet() . '(' . $varname . ')
    {
        ' . $forceCast . (!empty($forceCheck) ? "\n" . $forceCheck . "\n" : '') . '

        if ($this->exists() && $this->' . $this->getPropertyName() . ' !== ' . $varname . ') {
            $this->updated[\'' . $this->getPropertyName() . '\'] = true;
        }

        $this->' . $this->getPropertyName() . ' = ' . $varname . ';

        return $this;
    }';
    }