public function addField($name, $actual_field = null)
    {
        if ($this->hasElement($name)) {
            if ($name == $this->id_field) {
                return $this->getElement($name);
            }
            throw $this->exception('Field with this name is already defined')
            ->addMoreInfo('field', $name);
        }
        if ($name == 'deleted' && isset($this->app->compat)) {
            /** @type Field_Deleted $f */
            $f = $this->add('Field_Deleted', $name);
            return $f->enum(array('Y', 'N'));
        }

        // $f=parent::addField($name);
        /** @type Field $f */
        $f = $this->add($this->field_class, $name);
        //

        if (!is_null($actual_field)) {
            $f->actual($actual_field);
        }

        return $f;
    }