src/Charcoal/Admin/Widget/FormGroup/StructureFormGroup.php
public function setStorageProperty($propertyIdent)
    {
        $property = null;
        if ($propertyIdent instanceof PropertyInterface) {
            $property      = $propertyIdent;
            $propertyIdent = $property->ident();
        } elseif (!is_string($propertyIdent)) {
            throw new InvalidArgumentException(
                'Storage Property identifier must be a string'
            );
        }

        $obj = $this->obj();
        if (!$obj->hasProperty($propertyIdent)) {
            throw new UnexpectedValueException(sprintf(
                'The "%1$s" property is not defined on [%2$s]',
                $propertyIdent,
                get_class($obj)
            ));
        }

        if ($property === null) {
            $property = $obj->property($propertyIdent);
        }

        if ($property instanceof ModelStructureProperty) {
            $this->storageProperty = $property;
        } else {
            throw new UnexpectedValueException(sprintf(
                '"%s" [%s] is not a model structure property on [%s].',
                $propertyIdent,
                (is_object($property) ? get_class($property) : gettype($property)),
                (is_object($obj) ? get_class($obj) : gettype($obj))
            ));
        }

        return $this;
    }
public function setStorageProperty($propertyIdent)
    {
        $property = null;
        if ($propertyIdent instanceof PropertyInterface) {
            $property      = $propertyIdent;
            $propertyIdent = $property->ident();
        } elseif (!is_string($propertyIdent)) {
            throw new InvalidArgumentException(
                'Storage Property identifier must be a string'
            );
        }

        $obj = $this->obj();
        if (!$obj->hasProperty($propertyIdent)) {
            throw new UnexpectedValueException(sprintf(
                'The "%1$s" property is not defined on [%2$s]',
                $propertyIdent,
                get_class($obj)
            ));
        }

        if ($property === null) {
            $property = $obj->property($propertyIdent);
        }

        if ($property instanceof ModelStructureProperty) {
            $this->storageProperty = $property;
        } else {
            throw new UnexpectedValueException(sprintf(
                '"%s" [%s] is not a model structure property on [%s].',
                $propertyIdent,
                (is_object($property) ? get_class($property) : gettype($property)),
                (is_object($obj) ? get_class($obj) : gettype($obj))
            ));
        }

        return $this;
    }
public function setStorageProperty ( $ propertyIdent ) { $ property = null ; if ( $ propertyIdent instanceof PropertyInterface ) { $ property = $ propertyIdent ; $ propertyIdent = $ property -> ident ( ) ; } elseif ( ! is_string ( $ propertyIdent ) ) { throw new InvalidArgumentException ( 'Storage Property identifier must be a string' ) ; } $ obj = $ this -> obj ( ) ; if ( ! $ obj -> hasProperty ( $ propertyIdent ) ) { throw new UnexpectedValueException ( sprintf ( 'The "%1$s" property is not defined on [%2$s]' , $ propertyIdent , get_class ( $ obj ) ) ) ; } if ( $ property === null ) { $ property = $ obj -> property ( $ propertyIdent ) ; } if ( $ property instanceof ModelStructureProperty ) { $ this -> storageProperty = $ property ; } else { throw new UnexpectedValueException ( sprintf ( '"%s" [%s] is not a model structure property on [%s].' , $ propertyIdent , ( is_object ( $ property ) ? get_class ( $ property ) : gettype ( $ property ) ) , ( is_object ( $ obj ) ? get_class ( $ obj ) : gettype ( $ obj ) ) ) ) ; } return $ this ; }
Set the form group's storage target.

Must be a property of the form's object model that will receive an associative array
of the form group's data.

@param  string|ModelStructureProperty $propertyIdent The property identifier—or instance—of a storage property.
@throws InvalidArgumentException If the property identifier is not a string.
@throws UnexpectedValueException If a property is invalid.
@return self
Set the form group s storage target .