public function getRenderValue()
    {
        $name = $this->getName();
        $defaultValue = $this->getDefaultValue();
        $bean = $this->getBean();
        $value = "";

        if ($this->isCreate()) {

            // Create Page
            // Use Default Value if not null
            if ($this->value !== null) {
                $value = $this->value;
            } else if ($defaultValue !== null) {
                $value = $defaultValue;
            }

        } else {

            // Edit Page
            if ($this->getFieldRelation() == Field::MANY_TO_MANY) {
                // Many to many, Value list
                $keyName = "shared". ucfirst($name) . "List";

                $relatedBeans = $bean->{$keyName};
                $value = [];

                foreach ($relatedBeans as $relatedBean) {
                    $value[$relatedBean->id] = $relatedBean->id;
                }

            } else {

                // Single Value
                if ($this->isOverwriteValue() && $this->value !== null) {
                    // Use the value set by user.
                    $value = $this->value;
                } else {
                    // Use the value from Database
                    $value = $this->getFieldType()->beforeRenderValue($bean->{$name});

                    // Escape the html
                    $value = htmlspecialchars($value);
                }
            }

        }

        return $value;
    }
public function getRenderValue()
    {
        $name = $this->getName();
        $defaultValue = $this->getDefaultValue();
        $bean = $this->getBean();
        $value = "";

        if ($this->isCreate()) {

            // Create Page
            // Use Default Value if not null
            if ($this->value !== null) {
                $value = $this->value;
            } else if ($defaultValue !== null) {
                $value = $defaultValue;
            }

        } else {

            // Edit Page
            if ($this->getFieldRelation() == Field::MANY_TO_MANY) {
                // Many to many, Value list
                $keyName = "shared". ucfirst($name) . "List";

                $relatedBeans = $bean->{$keyName};
                $value = [];

                foreach ($relatedBeans as $relatedBean) {
                    $value[$relatedBean->id] = $relatedBean->id;
                }

            } else {

                // Single Value
                if ($this->isOverwriteValue() && $this->value !== null) {
                    // Use the value set by user.
                    $value = $this->value;
                } else {
                    // Use the value from Database
                    $value = $this->getFieldType()->beforeRenderValue($bean->{$name});

                    // Escape the html
                    $value = htmlspecialchars($value);
                }
            }

        }

        return $value;
    }
public function getRenderValue ( ) { $ name = $ this -> getName ( ) ; $ defaultValue = $ this -> getDefaultValue ( ) ; $ bean = $ this -> getBean ( ) ; $ value = "" ; if ( $ this -> isCreate ( ) ) { // Create Page // Use Default Value if not null if ( $ this -> value !== null ) { $ value = $ this -> value ; } else if ( $ defaultValue !== null ) { $ value = $ defaultValue ; } } else { // Edit Page if ( $ this -> getFieldRelation ( ) == Field :: MANY_TO_MANY ) { // Many to many, Value list $ keyName = "shared" . ucfirst ( $ name ) . "List" ; $ relatedBeans = $ bean -> { $ keyName } ; $ value = [ ] ; foreach ( $ relatedBeans as $ relatedBean ) { $ value [ $ relatedBean -> id ] = $ relatedBean -> id ; } } else { // Single Value if ( $ this -> isOverwriteValue ( ) && $ this -> value !== null ) { // Use the value set by user. $ value = $ this -> value ; } else { // Use the value from Database $ value = $ this -> getFieldType ( ) -> beforeRenderValue ( $ bean -> { $ name } ) ; // Escape the html $ value = htmlspecialchars ( $ value ) ; } } } return $ value ; }
GEt the value that will be rendered on HTML page
@return array|mixed|null|string
GEt the value that will be rendered on HTML page