public function init()
    {
        parent::init();

        if (!$this->our_field) {
            $this->our_field = $this->link;
        }

        if (!$this->owner->hasField($this->our_field)) {
            $this->owner->addField($this->our_field, [
                'type'              => $this->type,
                'reference'         => $this,
                'system'            => $this->system,
                'join'              => $this->join,
                'default'           => $this->default,
                'never_persist'     => $this->never_persist,
                'read_only'         => $this->read_only,
                'caption'           => $this->caption,
                'ui'                => $this->ui,
                'mandatory'         => $this->mandatory,
                'required'          => $this->required,
                'typecast'          => $this->typecast,
                'serialize'         => $this->serialize,
                'persist_format'    => $this->persist_format,
                'persist_timezone'  => $this->persist_timezone,
                'dateTimeClass'     => $this->dateTimeClass,
                'dateTimeZoneClass' => $this->dateTimeZoneClass,
            ]);
        }
    }
public function init()
    {
        parent::init();

        if (!$this->our_field) {
            $this->our_field = $this->link;
        }

        if (!$this->owner->hasField($this->our_field)) {
            $this->owner->addField($this->our_field, [
                'type'              => $this->type,
                'reference'         => $this,
                'system'            => $this->system,
                'join'              => $this->join,
                'default'           => $this->default,
                'never_persist'     => $this->never_persist,
                'read_only'         => $this->read_only,
                'caption'           => $this->caption,
                'ui'                => $this->ui,
                'mandatory'         => $this->mandatory,
                'required'          => $this->required,
                'typecast'          => $this->typecast,
                'serialize'         => $this->serialize,
                'persist_format'    => $this->persist_format,
                'persist_timezone'  => $this->persist_timezone,
                'dateTimeClass'     => $this->dateTimeClass,
                'dateTimeZoneClass' => $this->dateTimeZoneClass,
            ]);
        }
    }
public function init ( ) { parent :: init ( ) ; if ( ! $ this -> our_field ) { $ this -> our_field = $ this -> link ; } if ( ! $ this -> owner -> hasField ( $ this -> our_field ) ) { $ this -> owner -> addField ( $ this -> our_field , [ 'type' => $ this -> type , 'reference' => $ this , 'system' => $ this -> system , 'join' => $ this -> join , 'default' => $ this -> default , 'never_persist' => $ this -> never_persist , 'read_only' => $ this -> read_only , 'caption' => $ this -> caption , 'ui' => $ this -> ui , 'mandatory' => $ this -> mandatory , 'required' => $ this -> required , 'typecast' => $ this -> typecast , 'serialize' => $ this -> serialize , 'persist_format' => $ this -> persist_format , 'persist_timezone' => $ this -> persist_timezone , 'dateTimeClass' => $ this -> dateTimeClass , 'dateTimeZoneClass' => $ this -> dateTimeZoneClass , ] ) ; } }
Reference_One will also add a field corresponding
to 'our_field' unless it exists of course.
Reference_One will also add a field corresponding to our_field unless it exists of course .