Pimcore\Model\Object\ClassDefinition\Data\CalculatedValue::getSetterCodeLocalizedfields PHP Method

getSetterCodeLocalizedfields() public method

Creates setter code which is used for generation of php file for localized fields in classes using this data type
public getSetterCodeLocalizedfields ( $class ) : string
$class
return string
    public function getSetterCodeLocalizedfields($class)
    {
        $key = $this->getName();
        $code = '/**' . "\n";
        $code .= '* Set ' . str_replace(["/**", "*/", "//"], "", $this->getName()) . " - " . str_replace(["/**", "*/", "//"], "", $this->getTitle()) . "\n";
        $code .= '* @param ' . $this->getPhpdocType() . ' $' . $key . "\n";
        $code .= "* @return \\Pimcore\\Model\\Object\\" . ucfirst($class->getName()) . "\n";
        $code .= '*/' . "\n";
        $code .= "public function set" . ucfirst($key) . " (" . '$' . $key . ', $language = null) {' . "\n";
        $code .= "\t" . 'return $this;' . "\n";
        $code .= "}\n\n";
        return $code;
    }