src/Charcoal/Admin/Widget/FormGroup/TemplateOptionsFormGroup.php
public function setTemplateProperty($propertyIdent)
    {
        if ($propertyIdent === null) {
            $this->templateProperty = null;

            return $this;
        }

        $property = null;
        if ($propertyIdent instanceof PropertyInterface) {
            $property      = $propertyIdent;
            $propertyIdent = $property->ident();
        } elseif (!is_string($propertyIdent)) {
            throw new InvalidArgumentException(
                '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($this->obj())
            ));
        }

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

        $this->templateProperty = $property;

        return $this;
    }
public function setTemplateProperty($propertyIdent)
    {
        if ($propertyIdent === null) {
            $this->templateProperty = null;

            return $this;
        }

        $property = null;
        if ($propertyIdent instanceof PropertyInterface) {
            $property      = $propertyIdent;
            $propertyIdent = $property->ident();
        } elseif (!is_string($propertyIdent)) {
            throw new InvalidArgumentException(
                '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($this->obj())
            ));
        }

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

        $this->templateProperty = $property;

        return $this;
    }
public function setTemplateProperty ( $ propertyIdent ) { if ( $ propertyIdent === null ) { $ this -> templateProperty = null ; return $ this ; } $ property = null ; if ( $ propertyIdent instanceof PropertyInterface ) { $ property = $ propertyIdent ; $ propertyIdent = $ property -> ident ( ) ; } elseif ( ! is_string ( $ propertyIdent ) ) { throw new InvalidArgumentException ( '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 ( $ this -> obj ( ) ) ) ) ; } if ( $ property === null ) { $ property = $ obj -> property ( $ propertyIdent ) ; } $ this -> templateProperty = $ property ; return $ this ; }
Set the form object's property for template controller choices.

Must be a property of the form's object model that will supply a list of properties.

@param  string|PropertyInterface $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 data is invalid.
@return StructureFormGroup
Set the form object s property for template controller choices .