src/Charcoal/Admin/Widget/FormGroup/StructureFormGroup.php
public function obj()
    {
        if ($this->obj === null) {
            $formGroup = $this->formGroup();
            if ($formGroup instanceof self) {
                $prop = $formGroup->storageProperty();
                $val  = $formGroup->obj()->propertyValue($prop->ident());

                $this->obj = $prop->structureVal($val, [ 'default_data' => true ]);
                if ($this->obj === null) {
                    $this->obj = clone $prop->structureProto();
                }
            } elseif ($this->form() instanceof ObjectContainerInterface) {
                $this->obj = $this->form()->obj();
            }

            if ($this->obj === null) {
                throw new RuntimeException(sprintf(
                    'The [%1$s] widget has no data model.',
                    static::CLASS
                ));
            }
        }

        return $this->obj;
    }
public function obj()
    {
        if ($this->obj === null) {
            $formGroup = $this->formGroup();
            if ($formGroup instanceof self) {
                $prop = $formGroup->storageProperty();
                $val  = $formGroup->obj()->propertyValue($prop->ident());

                $this->obj = $prop->structureVal($val, [ 'default_data' => true ]);
                if ($this->obj === null) {
                    $this->obj = clone $prop->structureProto();
                }
            } elseif ($this->form() instanceof ObjectContainerInterface) {
                $this->obj = $this->form()->obj();
            }

            if ($this->obj === null) {
                throw new RuntimeException(sprintf(
                    'The [%1$s] widget has no data model.',
                    static::CLASS
                ));
            }
        }

        return $this->obj;
    }
public function obj ( ) { if ( $ this -> obj === null ) { $ formGroup = $ this -> formGroup ( ) ; if ( $ formGroup instanceof self ) { $ prop = $ formGroup -> storageProperty ( ) ; $ val = $ formGroup -> obj ( ) -> propertyValue ( $ prop -> ident ( ) ) ; $ this -> obj = $ prop -> structureVal ( $ val , [ 'default_data' => true ] ) ; if ( $ this -> obj === null ) { $ this -> obj = clone $ prop -> structureProto ( ) ; } } elseif ( $ this -> form ( ) instanceof ObjectContainerInterface ) { $ this -> obj = $ this -> form ( ) -> obj ( ) ; } if ( $ this -> obj === null ) { throw new RuntimeException ( sprintf ( 'The [%1$s] widget has no data model.' , static :: CLASS ) ) ; } } return $ this -> obj ; }
Retrieve the form's object.

@throws RuntimeException If the form doesn't have a model.
@return \Charcoal\Model\ModelInterface
Retrieve the form s object .